- 博客(66)
- 问答 (1)
- 收藏
- 关注
原创 UVa:11044 - Searching for Nessy
easy……#includeint main(){ int t; while(scanf("%d", &t) != EOF){ while(t--){ int m, n; scanf("%d%d", &n, &m); int xc = (n - 2) % 3 ? (n - 2) / 3 +
2015-04-19 22:01:40 520
原创 UVa: UVA - 10719 Quotient Polynomial
以前遇到过类似的情况——在未知数组长度的情况下输入数组各元素,解决问题的关键是如何判断数组何时输入结束,经验以为OJ会以EOF结束输入,但RE了,以'\n'结束输入AC#includeconst int MAXN = 10100;int p[MAXN];int main(){ int k; while(scanf("%d", &k) != EOF){ in
2015-04-12 10:12:10 602
原创 UVa:10790 - How Many Points of Intersection?
数学推导即可。。。(等差数列求和)刚开始WA了一次,样例过了,但没注意到int型不能隐性转换为long long型(不知道为什么,求解!??!),强制转换后AC#includeint main(){ long long sum; int a, b; int t = 1; while(scanf("%d%d", &a, &b) != EOF){
2015-04-08 13:01:56 405
原创 UVa:846 - Steps
注意:“The length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the previous step.”相邻的
2014-11-01 14:49:51 472
原创 UVa:591 - Box of Bricks
#includeint a[60];int main() { int n, c = 0; while(scanf("%d", &n) != EOF) { if(!n) break; c++; a[0] = 0; for(int i=1; i <= n; i++){ s
2014-09-23 11:02:26 570
原创 UVa:253 - Cube painting
#includeint main(){ char c1[6],c2[6],c[13]; while(scanf("%s",c)!=EOF){ for(int i=0;i<6;i++){ c1[i]=c[i]; c2[i]=c[i+6]; } int t; for(int
2014-09-18 22:20:36 510
原创 UVa:10161 - Ant on a Chessboard
找规律……#include#includeint main(){ int time; while(scanf("%d",&time)!=EOF){ if(!time) break; int s=ceil(sqrt(time)); int N=s*s; if(s%2){
2014-09-18 22:18:31 428
原创 UVa:10785 - The Mad Numerologist
注意:在keep the vowel and consonant value minimum的基础上,要
2014-06-04 12:14:09 482
原创 UVa:10474 - Where is the Marble?
#include#include#includeusing namespace std;const int maxn=10000+10;int q[maxn],p[maxn][2];bool cmp(int a, int b){ return a<b;}int main(){ int m,n,T=0; while(~scanf("%d%d",&m,&n
2014-05-04 21:22:36 439
原创 UVa:10420 - List of Conquests
#include#include#includeusing namespace std;const int maxn=2000+10;struct Beauty{ char ctry[90]; int num;}bea[maxn];char B[90],b[90];bool cmp(Beauty a,Beauty b){ return strcmp(a.
2014-05-04 12:22:57 570
原创 UVa:465 - Overflow
百度的时候看到都用atof函数,好东西啊,可是他转换也是在实数范围的-1.7*10^(-308) ~ 1.7*10^308,所以数据弱了没超过308位的数字。
2014-04-26 23:05:06 493
原创 UVa:10815 - Andy's First Dictionary
gets输入:#include#include#include#includeusing namespace std;char text[210],comp[210];struct Word{ char word[210];}w[5010];bool cmp(struct Word a,struct Word b){ return strcmp(a.word,b
2014-04-24 18:47:14 375
原创 UVa:537 - Artificial Intelligence?
-------------------------------------------------------------------------------------------- Keep It Simple,Stupid!------------------------------------------------------------------------
2014-04-21 13:49:59 502
原创 HDU:1235-统计同成绩学生人数
#include#includeint N,a[110];int main(){ while(scanf("%d",&N)!=EOF){ if(N==0) break; memset(a,0,sizeof(a)); for(int i=1;i<=N;i++){ int x; scanf("
2014-01-08 10:42:49 680
原创 HDU: 1201-18岁生日
I‘m Back!#includeint main(){ int T; while(scanf("%d",&T)!=EOF){ while(T--){ int Y,M,D,S=0; scanf("%d-%d-%d",&Y,&M,&D); if(M==2&&D==29)
2013-11-13 22:40:01 506
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人