随笔分类 - 数论
摘要:6069: Detachment 时间限制(普通/Java):2000MS/6000MS 内存限制:65536KByte 总提交: 33 测试通过:7 描述 In a highly developed alien society, the habitats are almost infinite d
阅读全文
摘要:1546: Just Pour the Water 时间限制(普通/Java):1000MS/10000MS 内存限制:65536KByte总提交: 63 测试通过:29 描述 Shirly is a very clever girl. Now she has two containers (A a
阅读全文
摘要:桃子的矩阵快速幂 时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte 总提交: 6 测试通过:3 描述 桃子得到了一个递推式,f(n)=2*f(n-2)+f(n-1)+n^4,f(1)=a,f(2)=b,现在给你n,a,b,要你计算f(n)的值为多少。 输入 第一
阅读全文
摘要:6064: Happy Necklace 时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte 总提交: 28 测试通过:11 描述 Little Q wants to buy a necklace for his girlfriend. Necklaces are
阅读全文
摘要:Fibonacci Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 24331 Accepted: 16339 Description In the Fibonacci integer sequence, F0 = 0, F1 =
阅读全文
摘要:6071: Squarefree number 时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte 总提交: 49 测试通过:24 描述 In mathematics, a squarefree number is one which is divisible b
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/5/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C
阅读全文
摘要:一个正整数K,给出K Mod 一些质数的结果,求符合条件的最小的K。例如,K % 2 = 1, K % 3 = 2, K % 5 = 3。符合条件的最小的K = 23。 收起 一个正整数K,给出K Mod 一些质数的结果,求符合条件的最小的K。例如,K % 2 = 1, K % 3 = 2, K %
阅读全文
摘要:描述 给出正整数n和k,计算j(n, k)=k mod 1 + k mod 2 + k mod 3 + … + k mod n的值 其中k mod i表示k除以i的余数。 例如j(5, 3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5=0+1+0+
阅读全文
摘要:5845: A^B的约数和 时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte 总提交: 59 测试通过:14 描述 给定两个正整数A和B(0<=A, B<=5*107),求AB的所有约数之和,因为结果可能很大,你只要将结果对9901取余即可。 输入 两个正整数A
阅读全文
摘要:A/B Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12428 Accepted Submission(s): 9983 Problem De
阅读全文
摘要:There is an interesting and simple one person game. Suppose there is a number axis under your feet. You are at point A at first and your aim is point
阅读全文
摘要:The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 (mod m). Input
阅读全文
摘要:青蛙的约会 TimeLimit:1000MS MemoryLimit:10MB TimeLimit:1000MS MemoryLimit:10MB 64-bit integer IO format:%lld 64-bit integer IO format:%lld 已解决 | 点击收藏 | 已有3
阅读全文
摘要:H1N1 like to solve acm problems.But they are very busy, one day they meet a problem. Given three intergers a,b,c, the task is to compute a^(b^c))%3170
阅读全文
摘要:a^-1 mod p 就是 我们要求的,这个值的结果恒等于 a^p-2 mod p inline int ksm(int x,int y){ int ans1=1;while (y){ if (y&1) ans1=1ll*ans1*x%Mod; y>>=1;x=1ll*x*x%Mod; }retur
阅读全文
摘要:描述 taozi喜欢数学,但是遇到数学题就头疼,zdragon为了让大家高兴高兴,给taozi出了道难题: S=∑qi (1≤i≤n),由于答案可能会很大,答案对p取模。 taozi喜欢数学,但是遇到数学题就头疼,zdragon为了让大家高兴高兴,给taozi出了道难题: S=∑qi (1≤i≤n)
阅读全文
摘要:1840: Jack Straws 时间限制(普通/Java):1000MS/10000MS 内存限制:65536KByte 总提交: 168 测试通过:129 描述 In the game of Jack Straws, a number of plastic or wooden "straws"
阅读全文