
online judge UVA
文章平均质量分 78
Albert__s
一直奔跑总会有出头之日。
展开
-
UVa 1584 Circular Sequence 【数组和字符串】
Time limit: 3.000 secondsDescriptionSome DNA sequences exist in circular forms as in the following figure, which shows a circular sequence “CGAGTCAGCT”, that is, the last symbol “T” in “CGAGTCAGCT”原创 2017-01-25 19:40:18 · 601 阅读 · 0 评论 -
1990 ICPC WF B Squares【暴力】
题目链接:UVa 201 SquaresDescription: A children’s board game consists of a square array of dots that contains lines connecting some of the pairs of adjacent dots. One part of the game requires that the原创 2017-06-02 22:45:18 · 556 阅读 · 0 评论 -
1999 ICPC WF H Flooded! 【思维】【细节】
题目链接: UVA-815 Description: To enable homebuyers to estimate the cost of flood insurance, a real-estate firm provides clients with the elevation of each 10-meter by 10-meter square of land in regions wh原创 2017-06-06 00:31:36 · 592 阅读 · 0 评论 -
1990 ICPC WF C Repeating Decimals 【数组和字符串】【模拟】
题目链接: UVa 202Description: The decimal expansion of the fraction 1/33 is 0.03, where the 03 is used to indicate that the cycle 03 repeats indefinitely with no intervening digits. In fact, the decima原创 2017-06-02 20:31:55 · 473 阅读 · 0 评论 -
UVa 10325 The Lottery 【容斥】【入门】
题目链接:UVa 10325 The Lottery Description: The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. There are so many participants this time that they cannot原创 2017-07-29 11:39:47 · 549 阅读 · 0 评论 -
UVa 11806 Cheerleaders 【容斥】【入门】
题目链接:UVa 11806 Cheerleaders Description: In most professional sporting events, cheerleaders play a major role in entertaining the spectators. Their roles are substantial during breaks and prior to s原创 2017-07-29 11:47:18 · 850 阅读 · 0 评论 -
UVa 12096 The SetStack Computer 【STL】【stack】
题目链接:点击打开链接紫书116页AC代码:#include #include #include #include #include #include #include #include #include using namespace std;#define ALL(x) x.begin(),x.end()#define INS(x) inserter(x, x原创 2017-02-26 23:44:19 · 525 阅读 · 0 评论 -
UVa 1605 Building for UN 【技巧】
题目链接:UVa 1605 Building for UN Description:The United Nations has decided to build a new headquarters in Saint Petersburg, Russia. It will have a form of a rectangular parallelepiped and will consist of原创 2017-08-18 21:08:50 · 486 阅读 · 0 评论 -
UVa 120 Stacks of Flapjacks 【排序】
题目链接:UVa 120 Stacks of FlapjacksDescription:Stacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, operating systems, and discrete event s原创 2017-08-18 20:57:00 · 394 阅读 · 0 评论 -
UVa 12412 A Typical Homework (a.k.a Shi Xiong Bang Bang Mang) 【模拟】
题目链接:UVa 12412A Typical Homework(a.k.a Shi Xiong Bang Bang Mang)Hi, I am an undergraduate student in institute of foreign languages. As you know, C programming is a required course in our univer原创 2017-08-04 19:07:35 · 864 阅读 · 4 评论 -
UVa 10815 Andy's First Dictionary 【STL】【set】
题目链接:点击打开链接练习set的用法,可参考紫书112页AC代码:#include #include #include #include #include #include #include #include using namespace std;set dict; //string集合int main(){ string s, buf; w原创 2017-02-21 18:42:43 · 455 阅读 · 0 评论 -
UVa 101 The Blocks Problem 【STL】【vector】【模拟】
题目:点击打开链接紫书110页小技巧:输入的四种指令,找到其共同点会使代码简单多AC代码:#include #include #include #include #include #include using namespace std;const int maxn = 30;int n;vector pile[maxn];void find_block(i原创 2017-02-26 22:56:25 · 322 阅读 · 0 评论 -
UVa 10976 Fractions Again?! 【暴力】【基础】
题目链接:点击打开链接公式挺好推的,注意一下枚举的范围即可详见紫书183页AC代码:#include #include #include #include #include using namespace std;int a[10005][5];int main(){ int k, ans, tem, i; while(~scanf("%d",&k)原创 2017-02-22 18:08:19 · 484 阅读 · 0 评论 -
UVa 227 Puzzle 【数组和字符串】【模拟】
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=163(因为格式的原因 贴过来看起来很不舒服 所以直接发链接了,中文版可参考紫书57页习题3-5)思路很清晰就是简单地模拟一下,根据它的指令来做就好了。输入注意一下。AC代码:#incl原创 2017-02-03 01:34:02 · 473 阅读 · 0 评论 -
UVa 1368 DNA Consensus String 【字符串】【贪心】
题目看这里~题意:懒得写了 想看的话可以找紫书58页习题3-7 或者 参考别人的博客(刚开始还以为是在给定的DNA中选出一个,但看样例怎么也不动,再看时才发现是构造一个新的DNA序列这也没什么好讲的 认真读题然后注意一下小细节(已用//注释出来AC代码:#include #include #include #include #include using namespace原创 2017-02-03 13:32:02 · 340 阅读 · 0 评论 -
UVa 455 Periodic Strings 【字符串求周期】
题目传送门:UVa 455 周期串 翻译可参照紫书57页习题3-4题意:给定一个字符串 求出它的最小循环周期AC代码:#include #include #include #include #include using namespace std;char s[105];int main(){ int n, i, j, len; while(~scanf原创 2017-02-03 12:32:48 · 453 阅读 · 0 评论 -
UVa 10474 Where is the Marble? 【STL】【排序与检索-sort和lower_bound】
AC代码:原创 2017-02-07 22:55:40 · 492 阅读 · 0 评论 -
UVa 489 Hangman Judge 【模拟】【练习函数的用法】
题目链接:点击打开链接题目大意及思路等参照紫书79-81页,也有代码。AC代码:#include #include #include #include #include using namespace std;int n, lena, lens, lefta;int win, lose, chance;char a[105], s[105];void guess(c原创 2017-02-12 23:34:09 · 510 阅读 · 0 评论 -
UVa 156 Ananagrams 【STL】【map】
题目链接:map的用法,参考紫书114页AC代码:#include #include #include #include #include #include #include using namespace std;map cnt;vector words;string repr(const string& s)//把每个单词“标准化”{ string原创 2017-02-21 19:12:03 · 1292 阅读 · 0 评论 -
UVa 540 Team Queue 【STL】【queue】
题目链接:点击打开链接参照紫书118页AC代码:#include #include #include #include #include #include #include using namespace std;const int maxn = 1005;int main(){ int t, cou = 0; while(~scanf("%d",&原创 2017-02-21 19:51:15 · 301 阅读 · 0 评论 -
UVa 136 Ugly Numbers 【STL】【priority_queue】
题目链接:点击打开链接参照紫书120页AC代码:#include #include #include #include #include #include #include #include using namespace std;typedef long long LL;const int coeff[3] = {2, 3, 5};int main(){原创 2017-02-21 20:06:06 · 398 阅读 · 0 评论 -
UVa 725 Division 【暴力入门】
题目链接:点击打开链接中文翻译见紫书182页一开始暴力想到了10个for循环,接着看了看书,5个就够了,写了会感觉好low啊。写完后有bug,debug时感觉好熟悉,突然想到了第二章的习题2-6,果断把5个for循环删掉,改为用一个for从1234到49385循环(abcde / fghij= N, N最小为2,只要循环到98765/2+1就行 )。这里判断数字是否重复用到了字符数组,原创 2017-02-21 22:16:51 · 945 阅读 · 0 评论 -
1999 ICPC WF C Morse Mismatches 【模拟】
PROBLEM C Morse Mismatches Input file: morse.inSamuel F. B. Morse is best known for the coding scheme that carries his name. Morse code is still used in international radio communication. The coding原创 2017-08-11 20:46:25 · 644 阅读 · 0 评论