2014年8月3日
摘要: Prime Testhttp://poj.org/problem?id=1811 1 #include 2 #include 3 using namespace std; 4 typedef __int64 LL; 5 LL mulmod(LL a,LL b,LL c) { //ret=(... 阅读全文
posted @ 2014-08-03 17:41 gaolzzxin 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Raising Modulo Numbershttp://poj.org/problem?id=1995快速幂取模 1 #include 2 typedef __int64 LL; 3 LL quickpow(LL a,LL b,LL c){//快速幂求(a^b)%c 4 LL ret=1%... 阅读全文
posted @ 2014-08-03 16:33 gaolzzxin 阅读(121) 评论(0) 推荐(0) 编辑
摘要: The Euler functionhttp://acm.hdu.edu.cn/showproblem.php?pid=2824筛法 1 #include 2 #include 3 #define mt(a,b) memset(a,b,sizeof(a)) 4 typedef __int64 LL;... 阅读全文
posted @ 2014-08-03 16:09 gaolzzxin 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Primeshttp://poj.org/problem?id=3978 1 #include 2 #include 3 #include 4 #define mt(a,b) memset(a,b,sizeof(a)) 5 using namespace std; 6 const int M=100... 阅读全文
posted @ 2014-08-03 14:45 gaolzzxin 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Least Common Multiplehttp://acm.hdu.edu.cn/showproblem.php?pid=1019 1 #include 2 int gcd(int a,int b){ 3 return b?gcd(b,a%b):a; 4 } 5 int lcm(int ... 阅读全文
posted @ 2014-08-03 10:27 gaolzzxin 阅读(248) 评论(0) 推荐(0) 编辑