摘要: View CodeProblem : 1009 ( FatMouse' Trade ) Judge Status : AcceptedRunId : 5737621 Language : C++ Author : billforumCode Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta#include <iostream> #include <algorithm> #include <stdio.h> using namespace std; const int 阅读全文
posted @ 2012-04-09 18:23 wuzhibin 阅读(214) 评论(0) 推荐(0)
摘要: http://acm.hit.edu.cn/hoj/problem/view?id=1533用字符串表示整数,进行大数加法运算/*This Code is Submitted by billforum for Problem 1533 at 2012-03-30 14:50:02*/#include <iostream> #include <string.h> #include <stdio.h> #include <stack> using namespace std; int main() { string t1,t2,t; int z; i 阅读全文
posted @ 2012-03-30 14:53 wuzhibin 阅读(203) 评论(0) 推荐(0)
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=503#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int N=30000;const int M=105;bool ex[N];int coin[M];int main(){ int n,m,total; cin>>n; 阅读全文
posted @ 2012-03-19 15:04 wuzhibin 阅读(166) 评论(0) 推荐(0)
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=615#include <iostream>#include <cstdio>using namespace std;const int N=8000;long long num[N];int coin[6]={0,1,5,10,25,50};int main(){ int n; for(int i=1;i<=7500;i++) num[i]=0; nu 阅读全文
posted @ 2012-03-19 13:50 wuzhibin 阅读(313) 评论(1) 推荐(0)
摘要: /*This Code is Submitted by billforum for Problem 1249 at 2012-03-18 18:47:08*/#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int N=15;const int MAX=100000000;int x[N],m[N][N],d[N][N];void print(int i,int j){ if(i==j) printf("A%d",i); else 阅读全文
posted @ 2012-03-18 18:51 wuzhibin 阅读(198) 评论(0) 推荐(0)
摘要: 0/1背包问题,只是对于每一个volume保留前k个值,View CodeProblem : 2639 ( Bone Collector II ) Judge Status : AcceptedRunId : 5569215Language : C++Author : billforumCode Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta#include <iostream>#include <cstring>#include <cstdio>using namespa 阅读全文
posted @ 2012-03-17 16:08 wuzhibin 阅读(561) 评论(0) 推荐(0)
摘要: #include <iostream>#include <cmath>#include <stdio.h>#include <string.h>#include <memory.h>using namespace std;const int N=1005;int vol[N],pv[N],val[N];int max(int x,int y){ return(x>y?x:y);}int main(){ int n,v,test; cin>>test; while(test--) { cin>>n>& 阅读全文
posted @ 2012-03-16 22:06 wuzhibin 阅读(544) 评论(0) 推荐(0)
摘要: (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个.最后取光者得胜.n = (m+1)r+s , (r为任意自然数,s≤m),即n%(m+1) != 0,则先取者肯定获胜(二)威佐夫博奕(Wythoff Game):有两堆各若干个物品,两个人轮流从某一堆或同时从两堆中取同样多的物品,规定每次至少取一个,多者不限,最后取光者得胜.(ak,bk)(ak ≤ bk ,k=0,1,2,...,n)表示奇异局势求法:ak =[k(1+√5)/2], bk= ak + k (k=0,1,2,...,n方括号表示取整函数)判断:Gold=(1+ 阅读全文
posted @ 2012-03-12 10:37 wuzhibin 阅读(179) 评论(0) 推荐(0)
摘要: Source CodeProblem:2234User:billforumMemory:192KTime:16MSLanguage:C++Result:AcceptedSource Code#include <iostream>#include <cstdio>using namespace std;int main(){ int n,ans=0,tmp; while(cin>>n) { ans=0; for(int i=0;i<n;i++) { cin>>tmp; ans^=tmp; } if(ans==0) printf("N 阅读全文
posted @ 2012-03-12 10:37 wuzhibin 阅读(137) 评论(0) 推荐(0)
摘要: http://acm.bupt.edu.cn/onlinejudge/newoj/showProblem/show_problem.php?problem_id=5Problem Id:5Submit time:2012-03-06 21:04:57User_id:10839Memory:152K Time:6MSLanguage:G++Result:AcceptedCode#include<iostream>#include<algorithm>constintN=1030;intdata[N],bk[N],n;voidprint(intn,int*d){ for(i 阅读全文
posted @ 2012-03-06 21:24 wuzhibin 阅读(205) 评论(0) 推荐(0)