ZOJ
DSQ_17
这个作者很懒,什么都没留下…
展开
-
ZOJ1713 Haiku Review
又是一把过啊,特此纪念下~ 字符串指针和string变量的对应- - ╮(╯▽╰)╭学艺不精。。感觉得重新学一遍C++#include #include using namespace std;bool isVowel(char ch){ return (ch=='a'||ch=='o'||ch=='e'||ch=='i'||ch=='u'||ch=='y');}int原创 2014-03-21 17:06:34 · 571 阅读 · 0 评论 -
ZOJ 2571 Big String Outspread
不太会用递归的说。。不过一把过了,jini原创 2014-09-21 17:45:38 · 545 阅读 · 0 评论 -
ZOJ 2744 Palindromes
刚开始暴力穷举的,果断tle了。。。原创 2014-06-03 00:28:08 · 807 阅读 · 1 评论 -
ZOJ 2481 Unique Ascending Array
插入排序:有点挫~#include using namespace std;int main(){ int n; int arr[100]; int tmp,cnt; while(cin>>n&&n!=0) { cin>>arr[0]; cnt=1; for(int i=1;i<n;i++) { cin>>tmp; int j=cnt-1;原创 2014-05-28 13:27:38 · 508 阅读 · 0 评论 -
【求助】zoj 2476求和水题
据说是个水题,不过还是总WA。。求大神给瞄一眼。题目描述如下:Total AmountTime Limit: 2 Seconds Memory Limit: 65536 KBGiven a list of monetary amounts in a standard format, please calculate the total amount.We de原创 2014-05-25 15:23:05 · 520 阅读 · 0 评论 -
zoj 2850 Beautiful Meadow
时间复杂度最好情况和最坏情况一样,都bixu原创 2014-06-07 19:25:00 · 609 阅读 · 0 评论 -
ZOJ 2358 Sum of Factorials
递归;实际用不上,见注释掉的:// ZOJ2358.cpp : 定义控制台应用程序的入口点。//#include #include using namespace std;int fab(int n){ if(n==0)return 1; int sum=1; for(;n>=1;n--)sum*=n; return sum;}int getMax(int n原创 2014-05-25 12:43:43 · 559 阅读 · 0 评论 -
ZOJ 2886 Look and Say
很挫的代码。。。不过思路比较简单#include #include using namespace std;void inputPos(char *p,int *pos,int num){ int tmp=*pos; int arr[4],i=0; while(num) { arr[i++]=num%10; num/=10; } i--; while(i>=0)原创 2014-06-07 21:18:19 · 799 阅读 · 0 评论 -
ZOJ 2830 Champion of the swordsmanship
刚开始理解错题意了。。网上找了两个答案,如下:转载 2014-06-05 21:10:09 · 599 阅读 · 0 评论 -
ZOJ 2781 Rounders
字符串处理的。。。原创 2014-06-05 13:50:10 · 599 阅读 · 0 评论 -
ZOJ 2679 OldBill
先贴代码:#include using namespace std;int main(){ int testNum; cin>>testNum; int cnt,x,y,z; while(testNum--) { cin>>cnt>>x>>y>>z; int firstBit,lastBit,cost=0; for(firstBit=9;firstBit>0;fir原创 2014-06-02 19:40:12 · 600 阅读 · 0 评论 -
ZOJ 2722 Head-to-head match
刚开始由于溢出tle...原创 2014-06-02 20:17:27 · 717 阅读 · 0 评论 -
ZOJ 1113
coutcout好吧。。表示无聊了。。#include #include using namespace std;int main(){ double sum=1,n=1; cout<<"n e\n- -----------\n0 1\n"; for(int i=1;i<10;++i) { n/=i; sum+=n; if(i>2)cout<<setpre原创 2014-03-25 14:38:26 · 700 阅读 · 0 评论 -
ZOJ 2105 Number Sequence
昨天看了一下午也没看出来。。发了个帖子得到大神指点,好好写了下注释才找出毛病。。。原来是下标搞错了。。教训是一定要按原理来,不能按测试的数据去瞎碰。#includeusing namespace std;int main(){ int a,b,n; int arr[100]; while(1) { cin>>a>>b>>n; if(a==0&&b==0&&n==原创 2014-03-25 15:28:58 · 503 阅读 · 0 评论 -
ZOJ2104 Let the Balloon Rise
头文件string.h和string是有区别滴~#include#include using namespace std;int main(){ while(1) { int num; string arr[1000]; string result; cin>>num; if(num==0)break; int max=0; int i=0,原创 2014-03-24 16:55:32 · 515 阅读 · 0 评论 -
ZOJ1414 Number Steps
难得的一把过,头一次诶~#include using namespace std;int main(){ int num; cin>>num; while(num--) { int x,y; cin>>x>>y; if(x==y||x-y==2) { if(x%2)cout<<x+y-1; else cout<<x+y;cout<原创 2014-03-21 17:08:28 · 486 阅读 · 0 评论 -
ZOJ1716Get Many Persimmon Trees
最近运气不错~水水更健康~#include using namespace std;bool isInRect(int baseX,int baseY,int width,int height,int x,int y){ return (baseX<=x&&baseY<=y&&x<=baseX+width-1&&y<=baseY+height-1);}int main(){原创 2014-03-22 14:03:56 · 576 阅读 · 0 评论 -
ZOJ 1246 Instant Complexity
问题代码。。改了一下午。。没事干的大神帮忙瞅瞅原创 2014-09-24 15:47:40 · 574 阅读 · 0 评论