
ACM比赛题目及总结
wujiekd
做你认为正确的事。https://wujiekd.github.io/zh-cn
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU - 2027-统计元音字母
统计每个元音字母在字符串中出现的次数。Input输入数据首先包括一个整数n,表示测试实例的个数,然后是n行长度不超过100的字符串。Output对于每个测试实例输出5行,格式如下:a:num1e:num2i:num3o:num4u:num5多个测试实例之间由一个空行隔开。请特别注意:最后一块输出后面没有空行:)Sample Input2aeioumy name is ...原创 2018-12-18 16:38:06 · 211 阅读 · 0 评论 -
H - Problem H-A + B = Sum
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer T(1<=T<=20) which means the num...原创 2018-12-16 18:58:42 · 234 阅读 · 0 评论 -
B - Problem B-分可乐
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>...原创 2018-12-16 18:48:32 · 623 阅读 · 0 评论 -
G - Problem G-求n的n次方结果最右边数字
Given a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test ca...原创 2018-12-16 00:39:19 · 1117 阅读 · 0 评论 -
HDU - 2005-第几天?
给定一个日期,输出这个日期是该年的第几天。Input输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。Output对于每组输入数据,输出一行,表示该日期是该年的第几天。Sample Input1985/1/202006/3/12Sample Output2071我的见解:第一步跟之前我...原创 2018-12-10 13:10:39 · 255 阅读 · 0 评论 -
CodeForces - 515A-Drazil and Date
Someday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil’s home is located in point (0, 0) and Varda’s home is located in point (a, b). In each step, he can mo...原创 2018-12-10 13:08:20 · 212 阅读 · 0 评论 -
HDU - 2039-三角形
给定三条边,请你判断一下能不能组成一个三角形。Input输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000;Output对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。Sample Input21 2 32 2 2Sample OutputNOYES我的见解:比较简单的一道题目,要注...原创 2018-12-10 12:51:10 · 119 阅读 · 0 评论 -
CodeForces-4A-Watermelon
One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w ki...原创 2018-12-10 12:49:38 · 273 阅读 · 0 评论 -
HDU2099-整除的尾数
Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?Input输入数据有若干组,每组数据包含二个整数a,b(0<a<10000, 10<b<100),若遇到0 0则处理结束。Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没...原创 2018-12-15 10:51:28 · 179 阅读 · 0 评论 -
1049-Climbing Worm
Problem DescriptionAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, it...原创 2018-12-13 20:09:40 · 201 阅读 · 0 评论 -
HDU-2101-A + B Problem Too
This 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 result.InputEach line w...原创 2018-12-06 22:56:56 · 183 阅读 · 0 评论 -
hdu-2002-计算球体积
根据输入的半径值,计算球的体积。Input输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。Output输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。Sample Input11.5Sample Output4.18914.137Hint#define PI 3.1415927链接:https://vjudge.net/problem/h...原创 2018-12-06 22:54:38 · 246 阅读 · 0 评论 -
hdu-2000-ASCII码排序
输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample InputqweasdzxcSample Outpute q wa d sc x z链接:https://vjudge.net/problem/hdu-2000...原创 2018-12-06 22:51:48 · 129 阅读 · 0 评论 -
hdu-1106-排序
输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。Input输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字的长度不大于1000。输入数据保证:...原创 2018-12-06 22:45:23 · 309 阅读 · 0 评论 -
hdu-1000-A + B Problem
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.Sample Input1 1Sample Output2链接:https://vjudge.net/probl...原创 2018-12-06 22:32:55 · 171 阅读 · 0 评论 -
CodeForces-266A-Stones on the Table
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 neighboring stones had different colors. Sto...原创 2018-12-06 22:29:57 · 196 阅读 · 0 评论 -
CodeForces-467A-George and Accommodation
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 a dormitory.George and Al...原创 2018-12-06 22:26:12 · 226 阅读 · 0 评论 -
CodeForces-118A-String Task
Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string, consisting if uppercase and ...原创 2018-12-06 22:17:10 · 270 阅读 · 0 评论 -
HDU - 1789-Doing Homework again
Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after th...原创 2019-01-30 01:00:06 · 146 阅读 · 0 评论 -
POJ-2253-Frogger(最短路)
DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of t...原创 2019-02-26 21:54:09 · 192 阅读 · 0 评论 -
POJ-3268-Silver Cow Party(最短路)
DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional ...原创 2019-02-26 21:54:28 · 219 阅读 · 0 评论 -
HDU - 1495 欧几里得 分可乐
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>...原创 2019-01-23 08:39:28 · 213 阅读 · 0 评论 -
HDU - 1576 欧几里得扩展 求mod的逆
要求(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 I原创 2019-01-22 01:47:04 · 436 阅读 · 0 评论 -
高精度运算-加法
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 numbers.“This supercompu...原创 2019-01-23 11:34:16 · 284 阅读 · 0 评论 -
HDU - 2049-考新郎(错排)
国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的:首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排;然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个.最后,揭开盖头,如果找错了对象就要当众跪搓衣板…看来做新郎也不是容易的事情…假设一共有N对新婚夫妇,其中有M...原创 2019-01-24 02:16:49 · 215 阅读 · 0 评论 -
HDU - 2191-珍惜现在,感恩生活(多重背包)
急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们...原创 2019-01-26 01:46:28 · 172 阅读 · 0 评论 -
HDU - 1114-Piggy-Bank(完全背包)
Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The i...原创 2019-01-26 01:11:48 · 221 阅读 · 0 评论 -
HDU - 1072-Nightmare(BFS)
Problem DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb ex...原创 2019-02-26 21:54:52 · 229 阅读 · 0 评论 -
HDU - 2102-A计划(BFS)
可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表示,墙用表示,平...原创 2019-02-26 21:54:41 · 182 阅读 · 0 评论 -
HDU - 2577-How to Type
Problem DescriptionPirates 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 ty...原创 2019-01-30 00:56:48 · 123 阅读 · 0 评论 -
HDU - 1159-Common Subsequence
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2, …, xm> another sequence Z = <z1, z2, …, zk> is a subseque...原创 2019-01-30 00:58:35 · 147 阅读 · 0 评论 -
HDU - 1241-Oil Deposits(DFS)
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th...原创 2019-01-30 01:01:18 · 144 阅读 · 0 评论 -
HDU - 1016-Prime Ring Problem(DFS)
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, …, n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of fir...原创 2019-01-30 01:02:54 · 157 阅读 · 0 评论 -
HDU - 2068-RPG的错排
今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;…可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我们的野骆驼想都知道她们,可现在有N多人,...原创 2019-01-30 01:04:00 · 158 阅读 · 0 评论 -
HDU - 1213-How Many Tables
Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a...原创 2019-01-30 01:07:10 · 210 阅读 · 0 评论 -
POJ - 2387-Til the Cows Come Home
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get b...原创 2019-01-30 01:08:30 · 119 阅读 · 0 评论 -
HDU - 1059-Dividing(多重背包)
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same v...原创 2019-01-30 01:10:10 · 182 阅读 · 0 评论 -
HDU - 1422-重温世界杯
世界杯结束了,意大利人连本带利的收回了法国人6年前欠他们的债,捧起了大力神杯,成就了4星意大利.世界杯虽然结束了,但是这界世界杯给我们还是留下许多值得回忆的东西.比如我们听到了黄名嘴的3分钟激情解说,我们懂得了原来可以向同一个人出示3张黄牌,我们还看到了齐达内的头不仅能顶球还能顶人…………介于有这么多的精彩,xhd决定重温德国世界杯,当然只是去各个承办世界杯比赛的城市走走看看.但是这需要一大比...原创 2019-02-26 21:55:02 · 204 阅读 · 0 评论 -
HDU - 2067-小兔的棋盘 卡特兰数
小兔的叔叔从外面旅游回来给她带来了一个礼物,小兔高兴地跑回自己的房间,拆开一看是一个棋盘,小兔有所失望。不过没过几天发现了棋盘的好玩之处。从起点(0,0)走到终点(n,n)的最短路径数是C(2n,n),现在小兔又想如果不穿越对角线(但可接触对角线上的格点),这样的路径数有多少?小兔想了很长时间都没想出来,现在想请你帮助小兔解决这个问题,对于你来说应该不难吧!Input每次输入一个数n(1&lt...原创 2019-01-24 00:27:33 · 319 阅读 · 0 评论