ACM题解
Alvin.W
人工智能在读研究生
展开
-
乔治与住宿#acm刷题
codeforce-467a(乔治与住宿)题目:George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into ...原创 2018-12-07 19:50:51 · 194 阅读 · 0 评论 -
GZHU18级寒假训练:Leo's Trial-D
HDU-2845(DP)Bean-eating is an interesting game, everyone owns an MN matrix, which is filled with different qualities beans. Meantime, there is only one bean in any 11 grid. Now you want to eat the b...原创 2019-01-29 12:01:21 · 180 阅读 · 0 评论 -
GZHU18级寒假训练:Leo's Trial-E
HDU-2870Now here is a matrix with letter ‘a’,‘b’,‘c’,‘w’,‘x’,‘y’,‘z’ and you can change ‘w’ to ‘a’ or ‘b’, change ‘x’ to ‘b’ or ‘c’, change ‘y’ to ‘a’ or ‘c’, and change ‘z’ to ‘a’, ‘b’ or ‘c’. Afte...原创 2019-01-29 12:12:41 · 205 阅读 · 0 评论 -
GZHU18级寒假训练:Leo's Trial-G
UVA-11624Joe works in a maze. Unfortunately, portions of the maze havecaught on fire, and the owner of the maze neglected to create a fireescape plan. Help Joe escape the maze.Given Joe’s locati...原创 2019-01-29 12:27:22 · 230 阅读 · 0 评论 -
GZHU18级寒假训练:Leo's Trial-I
HDU-1576(快速幂)要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output对应每组数据输出(A/B)%9973。Sample ...原创 2019-01-29 12:29:48 · 173 阅读 · 0 评论 -
GZHU18级寒假训练:Virgo's Trial-J
UVA-10382n sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkleris installed at the horizontal center line of the strip. For each sprinkler we are g...原创 2019-01-29 12:37:43 · 166 阅读 · 0 评论 -
GZHU18级寒假训练:Virgo's Trial-I
UVA-10020(贪心)Given several segments of line (int the X axis) with coordinates [Li , Ri ]. You are to choose the minimal amount of them, such they would completely cover the segment [0, M].InputThe...原创 2019-01-29 17:43:52 · 166 阅读 · 0 评论 -
GZHU18级寒假训练:Virgo's Trial-H
HDU-1495(BFS)大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,...原创 2019-01-29 17:54:11 · 175 阅读 · 0 评论 -
GZHU18级寒假训练:Libra's Trial-J
HDU-2067(卡特兰数)小兔的叔叔从外面旅游回来给她带来了一个礼物,小兔高兴地跑回自己的房间,拆开一看是一个棋盘,小兔有所失望。不过没过几天发现了棋盘的好玩之处。从起点(0,0)走到终点(n,n)的最短路径数是C(2n,n),现在小兔又想如果不穿越对角线(但可接触对角线上的格点),这样的路径数有多少?小兔想了很长时间都没想出来,现在想请你帮助小兔解决这个问题,对于你来说应该不难吧!Inp...原创 2019-01-29 18:03:43 · 173 阅读 · 0 评论 -
GZHU18级寒假训练:Libra's Trial-I
HDU-2049(错排)国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做&quot;考新郎&quot;,具体的操作是这样的:首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排;然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个.最后,揭开盖头,*如果找错了对象就要当众跪搓衣板… *看来做新郎也不是...原创 2019-01-30 16:42:15 · 127 阅读 · 0 评论 -
GZHU18级寒假训练:Libra's Trial-H
HDU 1015(DFS,多重循环)=== Op tech briefing, 2002/11/02 06:42 CST ===“The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them, alo...原创 2019-01-30 16:37:37 · 249 阅读 · 0 评论 -
GZHU18级寒假训练:Scorpio's Trial-J
HDU-1166(线段树)新算法!!!虽然老算法还没钻研透。。。看题C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干...原创 2019-01-30 16:47:33 · 182 阅读 · 0 评论 -
GZHU18级寒假训练:Scorpio's Trial-I
HDU-2068(错排)今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;…可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我们的野骆驼想...原创 2019-01-30 16:53:20 · 176 阅读 · 0 评论 -
GZHU18级寒假训练:Cancer's Trial-第十题
UVA-410The International Space Station contains many centrifuges in its labs. Each centrifuge will have somenumber © of chambers each of which can contain 0, 1, or 2 specimens. You are to write a p...原创 2019-01-29 11:56:15 · 153 阅读 · 0 评论 -
GZHU18级寒假训练:Cancer's Trial-第九题
UVA-424高精度运算(递归)One of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration ofpowers of 3 to go from 0 to 333 and he explored taking various sums of those number...原创 2019-01-29 11:33:53 · 187 阅读 · 0 评论 -
Stones on the Table#acm刷题
Stones on the TableCodeForces - 266A题目:There are n stones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two ne...原创 2018-12-07 20:03:26 · 214 阅读 · 0 评论 -
A+B问题#acm刷题
A + B Problemhdu-1000问题:Calculate A + B.InputEach line will contain two integers A and B. Process to end of file.OutputFor each case, output A + B in one line.sampleSample Input1 1Sample Ou...原创 2018-12-07 20:12:47 · 875 阅读 · 0 评论 -
ASCII码排序#acm刷题
ASCII码排序HDU-2000问题:输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample InputqweasdzxcSample Outpute q wa d sc x z问题分析:有输入就有输出,且三个...原创 2018-12-07 20:18:47 · 213 阅读 · 0 评论 -
计算球体积#acm刷题
计算球体积HDU-2002问题:根据输入的半径值,计算球的体积。Input输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。Output输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。Sample Input:11.5Sample Output4.18914.137Hint...原创 2018-12-07 20:58:14 · 756 阅读 · 0 评论 -
A+B问题(86整除版)#acm刷题
A+B问题(86)HDU-2101问题:his problem is also a A + B problem,but it has a little difference,you should determine does (a+b) could be divided with 86.For example ,if (A+B)=98,you should output no for res...原创 2018-12-07 21:04:54 · 257 阅读 · 0 评论 -
Let the Balloon Rise#acm刷题
Let the Balloon Rise#acm刷题Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 153632 Accepted Submission(s): 60940Problem DescriptionContest ...原创 2018-12-14 21:29:45 · 547 阅读 · 0 评论 -
A + B Again#acm刷题
A + B Againhdu-2057Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 37848 Accepted Submission(s): 15333Problem DescriptionThere must be m...原创 2018-12-14 21:37:01 · 245 阅读 · 0 评论 -
水仙花数#acm刷题
HDU 2010水仙花数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 266218 Accepted Submission(s): 74680Problem Description春天是鲜花的季节,水仙花就是其中最迷人的代...原创 2018-12-16 21:11:03 · 648 阅读 · 2 评论 -
数列有序#acm刷题
数列有序!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 121456 Accepted Submission(s): 50114Problem Description有n(n&lt;=100)个整数,已经按照从小到大顺序排列...原创 2018-12-16 21:15:55 · 146 阅读 · 0 评论 -
GZHU18级寒假训练:Cancer's Trial-第四题
HDU 2159题目:最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他...原创 2019-01-28 22:46:12 · 137 阅读 · 0 评论 -
GZHU18级寒假训练:Cancer's Trial-第五题
HDU-2577Pirates have finished developing the typing software. He called Cathy to test his typing software. She is good at thinking. After testing for several days, she finds that if she types a stri...原创 2019-01-28 23:03:51 · 175 阅读 · 0 评论 -
GZHU18级寒假训练:Cancer's Trial-第六题
HDU-2844Whuacmers use coins.They have coins of value A1,A2,A3…An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop....原创 2019-01-28 23:25:14 · 188 阅读 · 0 评论 -
GZHU18级寒假训练:Sagittarius's Trial-J
POJ-1251(最小生成树)The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roa...原创 2019-01-30 17:01:13 · 186 阅读 · 0 评论