摘要: 题目:Big Chocolate思路:很久之前写过,用递归一次一次的拆分的,写复杂了,直接输出m*n-1即可,证明自己想#include #include #include #include #include using namespace std;int main(){ long long m,n; while(scanf("%lld%lld",&m,&n)!=EOF) { cout<<m*n-1<<endl; } return 0;}View Code 阅读全文
posted @ 2013-06-23 10:07 over_flow 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题目:Quotient Polynomial思路:水题,就是感觉对输入有点措手不及,捡起来以前大一的时候用的读取到回车退出了。然后就是多项式分解。#include #include #include #include #include #include using namespace std;vectorv;int main(){ int k; char s; while(scanf("%d%*c",&k)!=EOF) { v.clear(); int tag=1,num=0; while(scanf("%c",&s)!=EOF... 阅读全文
posted @ 2013-06-23 10:07 over_flow 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目:Box of Bricks思路:水题。。。这个和挑战编程上那题一样,求最小移动啥啥的,所以只需要判断比均值大的和比均值小的部分,求最大值即可#include #include #include #include #include using namespace std;int num[55];int main(){ int n; int t=0; while(scanf("%d",&n),n) { int sum=0; for(int i=1;isum) tmp+=num[i]-sum; ... 阅读全文
posted @ 2013-06-23 10:03 over_flow 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目:The ? 1 ? 2 ? ... ? n = k problem思路:这个跟喵呜上次出的题一样,因为求的值化简一下就是sum(1...n)-2*subsum(1..n)=k,那么我们就只要保证(sum(1...n)-k)%2==0就行了,因为那个subsum是可以遍历1 to sum(1..n)的数的,同时要保证它大于0== 我直接交上次写的代码,结果WA了,原因在于多少还是有个trick的,output里有说n是大于等于1的,那么当k=0时,我的程序跑出来答案是0,很明显这个应该特判,答案是3(1+2-3)。#include #include #include #include #i 阅读全文
posted @ 2013-06-23 10:01 over_flow 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目:Secret Research思路:水题。。也是直接判断一下#include #include #include #include #include using namespace std;bool positive(string s){ if(s=="1"||s=="4"||s=="78") return true; return false;}bool negative(string s){ int l=s.size(); if(s[l-1]=='5'&&s[l-2]=='3' 阅读全文
posted @ 2013-06-23 09:55 over_flow 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目:Cube painting思路:水题。。。直接判断一下就是了#include #include #include #include #include using namespace std;int main(){ string a,b; while(cin>>a) { b=""; int i; for(i=6;i<=11;i++) b+=a[i]; int ans=0; for(i=0;i<3;i++) { if((a[0]==b[i]&&a[... 阅读全文
posted @ 2013-06-23 09:54 over_flow 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 题目:Ant on a Chessboard思路:直接暴力吧,大水#include #include #include #include #include using namespace std;int main(){ int n; while(scanf("%d",&n)!=EOF,n) { int cnt=0; long long sum=0; while(sumcnt) { now-=cnt; printf("%d %d\n",cnt-now,cn... 阅读全文
posted @ 2013-06-23 09:53 over_flow 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目:Power of Cryptography思路:水。。直接输出。。记住double比你想象中大得多#include #include #include #include #include using namespace std;int main(){ double n,p; while(scanf("%lf%lf",&n,&p)!=EOF) { printf("%.lf\n",pow(p,1.0/n)+1e-6); } return 0;}View Code 阅读全文
posted @ 2013-06-23 09:51 over_flow 阅读(121) 评论(0) 推荐(0) 编辑