摘要:
Problem HTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 2Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description The most important part of a GSM network is so called Base Transceiver Station (BTS). Th 阅读全文
摘要:
/*2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6738 Accepted Submission(s): 2022Problem Description Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.Input One positive integer on each line, the value of n. 阅读全文
摘要:
A+B ComingTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3359 Accepted Submission(s): 2087 Problem DescriptionMany classmates said to me that A+B is must needs. If you can’t AC this problem, you would invite me for night meal. ^_^InputInpu... 阅读全文
摘要:
初等数论昨晚写到凌晨近一点,终于把自己目前会的数论知识做了下终结,最后发现原来只有这么点东西。。。路还好远O(∩_∩)O哈!一.求最大公约数:gcd(a,b)代表a,b的最大公约数,设为d;(1)朴素算法:暴力枚举咯.,先比较a,b大小,然后从1开始直到较小的那个数,算出最大可以被2数同时整除的数,... 阅读全文
摘要:
除了2以外,素数都是奇数,这是关键1.快速查找素数(范围大所以用数组)#include #include #include #include #define N 1000000using namespace std;bool hash[N];int main(){ int i,j=0;(最快)0.3sfor(j=4;j#include#include#includeusing namespace std;const int M1=2000100,M2=1000000;bool NotPrime[M1]={1,1,0};int Prime[M2];int PrimeNum=0;int main( 阅读全文