
数论
AYZXX
这个作者很懒,什么都没留下…
展开
-
light_oj 1282
You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000), denoting the num原创 2017-08-15 10:42:51 · 346 阅读 · 0 评论 -
UVA 11827 Maximum GCD gcd
11827 - Maximum GCDTime limit: 1.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2927Given the N integers, you h原创 2017-08-15 12:44:41 · 424 阅读 · 0 评论 -
N - Trailing Zeroes (III)
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the t原创 2017-08-15 17:55:45 · 414 阅读 · 0 评论 -
Farey Sequence
The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 F2 = {1/2} F3 = {1/3, 1/2, 2/3} F4 = {1/4, 1/3, 1/2, 2/3, 3/4} F5 = {1/5, 1/4, 1/3, 2/原创 2017-08-15 19:38:06 · 401 阅读 · 0 评论 -
- Divisiblity of Differences CodeForces - 876B
You are given a multiset of n integers. You should select exactly k of them in a such way that the difference between any two of them is divisible by m, or tell that it is impossible.Numbers can b原创 2017-11-01 21:13:35 · 323 阅读 · 0 评论 -
Disgruntled Judge UVa 10375
题目链接思路:这道题是算法竞赛紫书第十章第316页的一个习题,上面有主要的代码;方法:因为含有阶乘,直接运算,数太大,一定会溢出的,而书上的方法,避免了这种溢出,而是采用分解的方法,利用数论中合数可以分解若干个素数相乘的形式,相乘或者相除时,只需在对应素数的指数相加减,即可。我们可以另开一个数组,用来对应存素数的指数。(代码简单易懂)。#include #include #原创 2017-12-07 20:59:18 · 258 阅读 · 0 评论