ACM水题训练
文章平均质量分 65
多练水题,提高手速和正确率。
风动护花
喜欢我你就关注我,有话说你就评论我,没话说你就点个赞≖‿≖✧
展开
-
CF 785A Anton and Polyhedrons
A. Anton and Polyhedronstime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputAnton’s favourite geometric figures are regular polyhedrons. Note...原创 2019-04-14 17:50:39 · 183 阅读 · 0 评论 -
CF 1131C Birthday
C. Birthdaytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCowboy Vlad has a birthday today! There are n children who came to the celebration....原创 2019-02-26 15:56:56 · 212 阅读 · 0 评论 -
CF 703A Mishka and Game
题目地址:http://codeforces.com/problemset/problem/703/AA. Mishka and Gametime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka is a little polar...原创 2019-02-18 10:45:29 · 161 阅读 · 0 评论 -
CF 584A Olesya and Rodion
题目地址http://codeforces.com/problemset/problem/584/AA. Olesya and Rodiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOlesya loves numbers co...原创 2019-02-18 10:36:49 · 172 阅读 · 0 评论 -
CF 758A Holiday Of Equality
题目地址:http://codeforces.com/problemset/problem/758/AA. Holiday Of Equalitytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Berland it is the...原创 2019-02-18 10:23:20 · 264 阅读 · 0 评论 -
CF 977A Wrong Subtraction
题目地址:http://codeforces.com/problemset/problem/977/AA. Wrong Subtractiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle girl Tanya is l...原创 2019-02-18 10:01:27 · 249 阅读 · 0 评论 -
CF 732A Buy a Shovel
题目地址:http://codeforces.com/problemset/problem/732/AA. Buy a Shoveltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp urgently needs a s...原创 2019-02-18 09:54:21 · 179 阅读 · 0 评论 -
CF 581A Vasya the Hipster
题目地址:http://codeforces.com/problemset/problem/581/AA. Vasya the Hipstertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Vasya the Hips...原创 2019-02-18 09:36:02 · 176 阅读 · 0 评论 -
CF 750A New Year and Hurry
A. New Year and Hurrytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLimak is going to participate in a contest on the last day of the 2016. T...原创 2019-02-16 14:11:30 · 238 阅读 · 0 评论 -
CF 791A Bear and Big Brother
题目地址:http://codeforces.com/problemset/problem/791/AA. Bear and Big Brothertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBear Limak wants to...原创 2019-01-08 11:06:21 · 244 阅读 · 0 评论 -
CF 705A Hulk
题目地址:http://codeforces.com/problemset/problem/705/AA. Hulktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDr. Bruce Banner hates his enemies ...原创 2019-01-08 10:55:38 · 183 阅读 · 0 评论 -
CF 339B Xenia and Ringroad
题目地址:http://codeforces.com/problemset/problem/339/BB. Xenia and Ringroadtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia lives in a cit...原创 2019-01-08 10:39:09 · 374 阅读 · 0 评论 -
CF 677A Vanya and Fence
题目地址:http://codeforces.com/problemset/problem/677/AA. Vanya and Fencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya and his friends ar...原创 2019-01-08 10:01:10 · 276 阅读 · 0 评论 -
CF 734A Anton and Danik
题目地址:http://codeforces.com/problemset/problem/734/AA. Anton and Daniktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnton likes to play ches...原创 2019-01-08 09:49:57 · 221 阅读 · 0 评论 -
CF 1095A Repeating Cipher
题目链接:http://codeforces.com/problemset/problem/1095/AA. Repeating Ciphertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp loves ciphers...原创 2019-01-08 09:22:12 · 258 阅读 · 0 评论 -
hsacm-1575
题目描述“如果两个人相差一秒出生,其中一个是小孩,那么另一个也是小孩。由此可以推论,所有人均是小孩。”数计系是一个由N个人组成的大家庭,分别为1, 2, 3, ..., N岁。 有一次系主任想为全系拍张合照,需要所有学生站成一排。起先他想按他们的岁数从小到大安排,但后来又觉得这样不自然。于是他建议按如下方案站排: 1岁的在最左边。 每相邻两人不得相差超过2岁。原创 2015-05-14 18:26:25 · 927 阅读 · 0 评论 -
cf-379C
技巧题:给出一串的数字,比如5 1 1,输出不能包含重复的数字而且总和尽量小的串。解法:用排序,排完之后遍历,比较目前值和前一个的值+1的大小。取大的数字#include #include #include #include #include #include #include #include #include #include #include #include #in原创 2015-05-16 20:24:38 · 459 阅读 · 0 评论 -
hsacm-1441
http://hsacm.cn/JudgeOnline/problem.php?cid=1009&pid=6题目描述Saya likes math, because she think math can make her cleverer.One day, Kudo invited a very simple game:Given N integers, then th原创 2015-05-23 11:37:16 · 616 阅读 · 0 评论 -
zoj-1002
这题说得是防火墙。个人理解:炮塔能打他所在的这一行和这一列,如果子弹遇到防火墙就会停止,如果遇到其他炮塔就打掉,所以,问你图里面能放最多多少个炮塔做法:设置一个函数ISOK判断这个位置能不能放炮塔,如果上下左右四个方向,有遇到炮塔的就返回0 ,其中如果当前点是防火墙也不能放置炮塔,也是0;然后直接遍历一遍数组,把所有能放置炮塔的计算出来。#include #include #i原创 2015-06-04 21:36:33 · 499 阅读 · 0 评论 -
HDU 4788 Hard Disk Drive
Hard Disk DriveTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1859 Accepted Submission(s): 1023Problem Description Yesterday your dea原创 2015-07-10 23:28:00 · 607 阅读 · 0 评论 -
HDU 3123 GCC
GCCTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 4266 Accepted Submission(s): 1401Problem DescriptionThe GNU Compiler Collection (u原创 2015-07-13 20:47:21 · 462 阅读 · 0 评论 -
ICPC 6823 Counting substhreengs
题意:求出满足要求的子串个数,要求是:子串都是数字,并且能被3整除。做法:动态规划的思想。弄一个数组记录当前选定值之前的情况,num[0]记录余数为0的个数。假设选定当前值作为数字的最后一个位数,如果当前值mod3等于1,那么前面num[2]的数加上当前值都能变成余数0,所以num[0]=num[2].以此类推......不用long long 会wa。#include#includ原创 2015-09-03 12:51:53 · 597 阅读 · 0 评论 -
ICPC 6834 Shopping
题意:有一个人去市场上买东西,他要穿越整个市场。市场是一条直线,线上有N家店。一般这个人不会去买东西,但是会有一个限制条件,比如C1,D1;意思是,想要路过D1店,必须返回C1店买东西,然后再回来。。所以最短的路线就是,直接穿越整个市场的路程加上重复的区间 。#include#includeusing namespace std;typedef struct pp{ int first原创 2015-09-06 12:45:07 · 471 阅读 · 0 评论 -
ICPC 6789 Superstitious Socks
题目意思是,这个人有很多袜子。socks(袜子的复数)但是他每只袜子长度都不一样。他每天穿一对长度差最小的袜子,穿完之后第二天就换,也就是说,每一对匹配出来的袜子他只会穿一天。求第K天他穿的袜子长度。解法:直接暴力是不对的。先对两只袜子的长度差进行二分。然后再查找长度差的值。关键在,计算这个长度差范围之内的袜子匹配种数。应为对袜子排序过。所以可以看出,中间一大段都是重复的计原创 2015-09-08 21:11:57 · 565 阅读 · 0 评论 -
HDU 3826 Squarefree number
Squarefree numberTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2754 Accepted Submission(s): 695Problem DescriptionIn mathemati原创 2015-10-02 10:30:01 · 506 阅读 · 0 评论 -
HDU 3819 A and B Problem
A and B ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 786 Accepted Submission(s): 251Problem DescriptionAfter calculatin原创 2015-10-02 10:56:30 · 557 阅读 · 0 评论 -
CF 158D Ice Sculptures
D. Ice Sculpturestime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Berland University is preparing to ce原创 2015-10-22 22:01:20 · 481 阅读 · 0 评论 -
CF 546C Soldier and Cards
C. Soldier and Cardstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo bored soldiers are playing card wa原创 2015-10-26 22:23:11 · 570 阅读 · 0 评论 -
CF 466C Number of Ways
C. Number of Waystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou've got array a[1], a[2], ..., a[n], c原创 2015-10-30 18:41:11 · 532 阅读 · 0 评论 -
CF 500C New Year Book Reading
C. New Year Book Readingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNew Year is coming, and Jaehyun de原创 2015-11-09 18:37:54 · 663 阅读 · 0 评论 -
HDU 新生赛 一道递推题
http://blog.csdn.net/loy_184548/article/details/50100179转载 2015-12-04 18:16:29 · 380 阅读 · 0 评论 -
1065. A+B and C (64bit) (20)
Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Specification:The first line of the input gives the positive number of test cases, T (<=10). Then T test c原创 2017-03-05 19:48:44 · 488 阅读 · 2 评论 -
cf-289B
题意:给一个矩阵和一个值D,矩阵内每个元素可以多次加减D,目的是让整个矩阵的元素都变得相等,如果做不到输出-1首先,矩阵是多余的,直接一个数组就行了,无非是让数组元素都相等从判断差值是不是倍数的问题入手,对于两数字A,B,如果它们的差值不是D的倍数,那么无论它们怎么加减都没办法变得一样,只要一对数字不行,整个序列就失败了对于两数字A,B,它们的差值是D的倍数,例如k原创 2015-06-04 21:08:58 · 876 阅读 · 0 评论 -
CF 554B Ohana Cleans Up
B. Ohana Cleans Uptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOhana Matsumae is trying to clean a room原创 2015-10-22 21:13:57 · 330 阅读 · 0 评论 -
CF 584B Kolya and Tanya
B. Kolya and Tanyatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKolya loves putting gnomes at the circle原创 2015-10-25 21:02:59 · 542 阅读 · 1 评论 -
CF 588B Duff in Love
B. Duff in Lovetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuff is in love with lovely numbers! A posi原创 2015-10-30 20:20:29 · 739 阅读 · 0 评论 -
CF 591B Rebranding
B. Rebrandingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe name of one small but proud corporation c原创 2015-11-04 16:18:17 · 433 阅读 · 0 评论 -
CF 509B Painting Pebbles
B. Painting Pebblestime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputThere are n piles of pebbles on the原创 2015-11-06 20:48:00 · 434 阅读 · 0 评论 -
CF 501B Misha and Changing Handles
B. Misha and Changing Handlestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha hacked the Codeforces si原创 2015-11-07 14:25:48 · 592 阅读 · 0 评论 -
PAT 1101 Quick Sort
https://pintia.cn/problem-sets/994805342720868352/problems/9948053663431884801101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we...原创 2019-08-28 10:22:48 · 117 阅读 · 0 评论