随笔分类 - 数论_同余定理
摘要:Problem Description Sample Input 2 2 Sample Output 2 Hint 1. For N = 2, S(1) = S(2) = 1. 2. The input file consists of multiple test cases. 解题思路:由于指数很
阅读全文
摘要:Problem Description: Input: 输入有多组数据,输入一个整数n(1 <= n <= 10^6),代表这个无聊者序列的个数。 Input: Output: 输出一个数,代表子序列的个数为多少,该数需要mod(1000000007) Output: Sample Input: 3
阅读全文
摘要:Problem Description: Problem Description: 斐波那契数列定义如下:f(0)=0,f(1)=1,f(n+2)=f(n+1)+f(n); 求斐波那契数列的第n项对10009取余后的结果。 Input: 多组测试,每组测试输入一个整数n(0<=n<=10^17).
阅读全文
摘要:Problem Description: Problem Description: 一个简单的问题,大家应该有不少做过大数加法题吧。这个题的数据也是64位整数放不下的,给定一个数,判断该数是否能整除18. Input: 输入包含多组测试数据,对于每组数据,输入一个整数(位数小于100,没有前导零).
阅读全文
摘要:Problem Description: Problem Description: 锴神:我尊重作者原意,你们出什么我就加什么。于是小光打了道水题(也就是这道),但是呢比赛的时候拿着自己的标程却AC不了,最后只能尴尬地打表!!为毛呢?!请你来看看这道题,为了缓解小光的尴尬,他决定不告诉你样例输入输出
阅读全文
摘要:Problem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to
阅读全文