摘要: DescriptionConsider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the re... 阅读全文
posted @ 2015-08-05 17:11 Bug_Clearlove 阅读(411) 评论(0) 推荐(0)
摘要: DescriptionYou are given a non-negative integern, its decimal representation consists of at most100digits and doesn't contain leading zeroes.Your task... 阅读全文
posted @ 2015-08-05 02:48 Bug_Clearlove 阅读(502) 评论(0) 推荐(0)
摘要: Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个... 阅读全文
posted @ 2015-08-05 02:42 Bug_Clearlove 阅读(235) 评论(0) 推荐(0)
摘要: Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers.InputThe first line of input... 阅读全文
posted @ 2015-08-05 00:00 Bug_Clearlove 阅读(318) 评论(0) 推荐(0)
摘要: 给定a,b,c,d, 满足bc>ad, 求使得cn−d⌊abn⌋最小的最小的n.数据规模:1≤a,b,c,d≤1018令y=⌊abx⌋,x=⌈bya⌉, 原问题等价于求cx−dy的最小值,ax≥by,x≥1,y≥0.分两种情况考虑1.a≥b令k=⌊ab⌋,y≥kx,c>ad/b≥kd令a′=a−kb... 阅读全文
posted @ 2015-05-06 13:18 Bug_Clearlove 阅读(269) 评论(0) 推荐(0)
摘要: 1.归并排序#include using namespace std;const int maxn = 1000;int a[maxn],b[maxn];int ans;void merge_sort(int x,int y){ if(y-x>1) { int m = x+... 阅读全文
posted @ 2015-05-02 00:37 Bug_Clearlove 阅读(881) 评论(0) 推荐(0)
摘要: 第一种方法是kmp:将一个数组复制一次,然后再用另一个进行匹配。#include #include #include #include using namespace std;const int N = 200005;const int MOD = 360000;int a[N],b[N],c[2*... 阅读全文
posted @ 2015-04-20 22:24 Bug_Clearlove 阅读(215) 评论(0) 推荐(0)
摘要: Problem CSAM I AMInput:Standard InputOutput:Standard OutputThe world is in great danger!!Mental'sforceshave returned to Earth to eradicate humankind. ... 阅读全文
posted @ 2015-04-17 15:05 Bug_Clearlove 阅读(243) 评论(0) 推荐(0)
摘要: G -Awesome Backup SystemTime Limit:2000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 2030DescriptionIt is known that all... 阅读全文
posted @ 2015-04-10 11:04 Bug_Clearlove 阅读(212) 评论(0) 推荐(0)
摘要: 完数6、28、496、8128、33550336 阅读全文
posted @ 2015-04-10 00:05 Bug_Clearlove 阅读(108) 评论(0) 推荐(0)