![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_模拟
tagyona
独立思考。不论是做题,还是人生。
展开
-
ZOJ 2850 Beautiful Meadow
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1850 #include #include using namespace std; int main() { int p[10][10]; int n,m; bool flag; while(cin>>n>>m,n||m){转载 2013-03-08 13:25:31 · 561 阅读 · 0 评论 -
HDU 1566 Color the ball
线段树或树状数组都可以做,下面提供更简单的一种方法,以前Codeforces见大牛用过。 #include #include using namespace std; const int maxn=100005; int f[maxn]; int main() { int n,x,y; while(scanf("%d",&n)&&n) { memset原创 2013-04-01 22:05:09 · 679 阅读 · 0 评论 -
hdu 2802——找循环节的方法拓展
#include #define maxn 110 #define mod 2009 using namespace std; int f[5000];//可以先开大数组找出循环节,再对数组放缩 int main() { //找循环节的方法 int n,i; f[1]=1; f[2]=7; for(i=3;;i++) { int t转载 2013-01-11 23:21:36 · 738 阅读 · 0 评论 -
POJ 2080/ZOJ 2420
题目链接:http://poj.org/problem?id=2080 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1420 #include #include #include using namespace std; char week[7][10]={"Saturday","Sunday","Mond转载 2013-03-09 13:01:09 · 649 阅读 · 0 评论 -
HDU 1896 Stones(优先队列)
简单模拟即可。 #include #include using namespace std; struct node { int pos,dis; bool operator <(const node t)const { if(pos!=t.pos) return pos>t.pos; return dis>t.dis; } }原创 2013-04-04 17:12:52 · 717 阅读 · 0 评论 -
HDU 1237 简单计算器 (栈模拟)
#include #include using namespace std; const int maxn =200+5; char s[maxn]; //考虑到 1 - 2 + 2 / 1 = 1.00 的特殊性,将减法转换为加法 int main() { while(gets(s)!=NULL) { int L=strlen(s); if(L原创 2013-04-05 13:32:16 · 707 阅读 · 1 评论 -
HDU 1165 Eddy's research II
很久没用草稿纸写过数学题了,以此贴留恋。 #include #include using namespace std; __int64 A(int m,int n) { if(m==0) return n+1; if(n==0) return A(m-1,1); if(m==1) return n+2;//A(1,n)=A(0,A(1,n-1))=A(1,n-1)+1原创 2013-04-10 21:23:58 · 570 阅读 · 0 评论