![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
OJ:UVa
文章平均质量分 59
NickHdx
有一口气点一盏灯
展开
-
UVa:10324 - Zeros and Ones
在写输出的时候,犹豫了一下:是该一下子全部输入后再全部输出呢,还是单个输入然后单个输出,凭感觉,应该是后者,就AC了。#includechar s[1000010];int main(){ int n,a,b,t; int count=0; while(scanf("%s",s)!=EOF){ count++; scanf("%d",原创 2013-05-11 22:03:47 · 1054 阅读 · 0 评论 -
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 · 492 阅读 · 0 评论 -
UVa:123 - Searching Quickly
题意:给出要被忽略的单词列表和要被排序的原创 2014-05-24 16:06:17 · 492 阅读 · 0 评论 -
UVa:10785 - The Mad Numerologist
注意:在keep the vowel and consonant value minimum的基础上,要原创 2014-06-04 12:14:09 · 463 阅读 · 0 评论 -
UVa:120 - Stacks of Flapjacks
题意:给出一叠煎饼的直径大小,原创 2014-05-14 17:41:45 · 486 阅读 · 0 评论 -
UVa:755 - 487--3279
找出有重复的电话号码并输出原创 2014-06-03 11:30:38 · 579 阅读 · 0 评论 -
UVa:10194 - Football (aka Soccer)
以下有两组代码,一组AC了,一组每原创 2014-05-30 19:10:32 · 690 阅读 · 0 评论 -
UVa:10494 - If We Were a Child Again
这道题想了一下午,没能完全想通,卡在原创 2014-04-27 21:49:51 · 587 阅读 · 0 评论 -
Uva:156 - Ananagrams
题意:输入纯英文文本,原创 2014-05-16 10:08:30 · 465 阅读 · 0 评论 -
UVa:113 - Power of Cryptography
作为初学者,二分查找能有如此的原创 2014-09-18 22:13:44 · 438 阅读 · 0 评论 -
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 · 415 阅读 · 0 评论 -
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 · 578 阅读 · 0 评论 -
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 · 504 阅读 · 0 评论 -
UVa:573 - The Snail
需要注意的地方是:1.原创 2014-10-19 21:56:49 · 445 阅读 · 0 评论 -
UVa:107 - The Cat in the Hat
刚开始没读懂题目,后来百度了一下中文翻译原创 2014-10-18 22:42:47 · 556 阅读 · 0 评论 -
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 · 464 阅读 · 0 评论 -
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 · 552 阅读 · 0 评论 -
UVa:10025 - The ? 1 ? 2 ? ... ? n = k problem
让1到n的数做算术运算(加)原创 2014-09-22 22:41:36 · 556 阅读 · 0 评论 -
UVa:621 - Secret Research
好水……本以为会是道细节题……还有原创 2014-09-19 19:52:12 · 527 阅读 · 0 评论 -
UVa:490 - Rotating Sentences
刚开始接触这道题时,并不知道如何结束输入,苦恼了好一阵,做HDU的hat‘s word时师兄给了提示之后才明白,“Ctrl+Z+回车” 是在这种情况下结束输入的。这道题还需注意的是:在某个句子输出完后,如果还要输出,则需在没有字符的位置用空格代替。就因为没注意到这一点,WA了好几次。#include#includechar se[110][110];int main(){ int原创 2013-05-21 10:53:05 · 581 阅读 · 0 评论 -
UVa:400 - Unix ls
题意:输入若干个“文件名”()原创 2014-05-19 20:22:09 · 547 阅读 · 0 评论 -
UVa:10361 - Automatic Poetry
按模式“ s1s3s5”来将第一句原创 2014-04-20 18:14:23 · 443 阅读 · 0 评论 -
UVa:152 - Tree's a Crowd
题意:给出若干个点的三维坐标,原创 2014-05-06 12:03:35 · 474 阅读 · 0 评论 -
UVa: 10010 - Where's Waldorf?
大概题意是:给一个m*n的字符矩阵,原创 2014-04-20 08:08:36 · 413 阅读 · 0 评论 -
UVa:401 - Palindromes
这是回归以后发表的第一道UVa的题目,略感原创 2014-04-19 09:33:29 · 427 阅读 · 0 评论 -
UVa:537 - Artificial Intelligence?
-------------------------------------------------------------------------------------------- Keep It Simple,Stupid!------------------------------------------------------------------------原创 2014-04-21 13:49:59 · 494 阅读 · 0 评论 -
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 · 429 阅读 · 0 评论 -
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 · 557 阅读 · 0 评论 -
UVa:340 - Master-Mind Hints
题意:设计者设计了一组编码原创 2014-05-02 18:08:28 · 535 阅读 · 0 评论 -
UVa:10878 - Decode the tape
观察磁带可知,磁带以“”原创 2014-04-23 17:31:19 · 510 阅读 · 0 评论 -
UVa:409 - Excuses, Excuses!
此题需要进行字符串的匹配,原创 2014-04-23 17:10:08 · 477 阅读 · 0 评论 -
UVa:10106 - Product
用数组存储大数,然后模拟原创 2014-04-26 20:52:53 · 447 阅读 · 0 评论 -
UVa:465 - Overflow
百度的时候看到都用atof函数,好东西啊,可是他转换也是在实数范围的-1.7*10^(-308) ~ 1.7*10^308,所以数据弱了没超过308位的数字。原创 2014-04-26 23:05:06 · 476 阅读 · 0 评论 -
UVa:748 - Exponentiation
一样的,用数组存储输入的数值,然后模拟乘法运算,原创 2014-04-27 11:50:46 · 533 阅读 · 0 评论 -
UVa:424 - Integer Inquiry
这题是大数问题,需要用字符数组输入,原创 2014-04-26 14:29:33 · 545 阅读 · 0 评论 -
UVa:10115 - Automatic Editing
此题又有字符匹配匹配的问题,原创 2014-04-26 09:41:44 · 476 阅读 · 0 评论 -
UVa:644 - Immediate Decodability
这题不难,但有些细节得多加注意(代码中的)原创 2014-04-24 22:25:39 · 397 阅读 · 0 评论 -
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 · 362 阅读 · 0 评论 -
UVa:299 - Train Swapping
题意:给出一列火车的车厢排列,要求将车厢原创 2014-05-09 23:04:56 · 603 阅读 · 0 评论 -
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 · 389 阅读 · 0 评论