摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4618 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 305 9 using namespace std; 10 11 vector G[maxn*maxn]; 12 int a[maxn][maxn]; 13 int maxp; 14 int N,M; 15 16 bool find(int u,int v){ 17 ... 阅读全文
posted @ 2013-07-28 20:19 等待最好的两个人 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4614 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxn 105000 10 #define lson l,mid,u>1; 21 seg[u>1; 28 seg[u>1; 43 build(lson); 44 build(rson); 45 } 46 void Update(int... 阅读全文
posted @ 2013-07-28 20:07 等待最好的两个人 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3468WA 在了数据类型上,seg[]要用longlong,输入也要注意. 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxn 12500010 #define lson l,mid,u>1;22 seg[u>1;37 build(lson);38 build(rson);39 PushUp(u);40 }41 void Update(int... 阅读全文
posted @ 2013-07-28 13:06 等待最好的两个人 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxn 13005010 #define lson l,mid,u mid) Update(L,R,num,rson);51 Push_UP(u);52 }53 54 int main()55 {56 if(freopen("input.txt","r",stdin... 阅读全文
posted @ 2013-07-27 20:47 等待最好的两个人 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2795 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxn 22222210 #define lson l,mid,u>1; 28 build(lson);29 build(rson);30 Push_UP(u);31 }32 void Update(int loc,int num,int l,int r,int u){33 ... 阅读全文
posted @ 2013-07-27 19:51 等待最好的两个人 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxn 23005010 #define lson l,mid,u mid) ret =max(ret,Query(L,R,rson));49 return ret;50 }51 int main()52 {53 if(freopen("input.txt","r",stdi 阅读全文
posted @ 2013-07-27 15:39 等待最好的两个人 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4619 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 1001 9 #define N 10510 using namespace std;11 12 int map[N][N];13 bool G[maxn][maxn];14 int n,m;15 int ans;16 bool vis[maxn];17 int link[maxn];18 in... 阅读全文
posted @ 2013-07-26 00:23 等待最好的两个人 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题目链接: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) 编辑