2014年8月5日
摘要: Hard Codehttp://acm.hdu.edu.cn/showproblem.php?pid=4813 1 #include 2 char op[1024]; 3 int main(){ 4 int t,n,m; 5 while(~scanf("%d",&t)){ 6 ... 阅读全文
posted @ 2014-08-05 09:33 gaolzzxin 阅读(205) 评论(0) 推荐(0) 编辑
  2014年8月4日
摘要: Task schedulehttp://acm.hdu.edu.cn/showproblem.php?pid=4907 1 #include 2 #include 3 #define mt(a,b) memset(a,b,sizeof(a)) 4 const int M=200010; 5 int ... 阅读全文
posted @ 2014-08-04 15:18 gaolzzxin 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Saving Beanshttp://acm.hdu.edu.cn/showproblem.php?pid=3037 1 #include 2 typedef __int64 LL; 3 const int M=100010; 4 class LUCAS { //lucas求组合数C(n,k)%p ... 阅读全文
posted @ 2014-08-04 14:29 gaolzzxin 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Last non-zero Digit in N!http://acm.hdu.edu.cn/showproblem.php?pid=1066 1 #include 2 #include 3 const int M=1024; 4 const int tomod[20]= {1,1,2,6,4,2,... 阅读全文
posted @ 2014-08-04 13:15 gaolzzxin 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Smith Numbershttp://poj.org/problem?id=1142http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=133 1 #include 2 int fac[128]; 3 int find_fac(in... 阅读全文
posted @ 2014-08-04 10:17 gaolzzxin 阅读(236) 评论(0) 推荐(0) 编辑
  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) 编辑