摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4602我们可以特判出n 2 using namespace std; 3 const long long moder = 1e9 + 7; 4 5 long long power(long long t){ 6 if(t == 0) return 1; 7 long long ans = power(t/2) % moder; 8 ans = ans * ans % moder; 9 if(t % 2) ans = ans * 2 % moder;10 r... 阅读全文
posted @ 2013-07-24 17:39 等待最好的两个人 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4607首先如果k小于等于直径长度,那么答案为k−1。如果k大于直径长度,设直径长度为r,那么答案为r−1+(k−r)∗2。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 105000 9 using namespace std;10 11 const int INF = 0x3f3f3f;12 13 vector G[maxn];14 int N,M... 阅读全文
posted @ 2013-07-24 15:29 等待最好的两个人 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4608 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 105000 9 using namespace std;10 11 int len;12 char a[maxn],b[maxn]; 13 14 15 int getsum(){16 int ans = 0; //printf("%d\n",len);17 for(int i=0... 阅读全文
posted @ 2013-07-24 12:57 等待最好的两个人 阅读(222) 评论(0) 推荐(0) 编辑