CodeForces
Rocky0429
我愿能朝着太阳生长,做一个温暖的人。
展开
-
Codeforces Round #288 (Div. 2)(A,B,C)
A. Pasha and Pixelstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPasha loves his phone and also putting原创 2015-01-31 11:06:40 · 1183 阅读 · 0 评论 -
Captain Marmot(Codeforces Round #271 div2) C
Captain MarmotTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionCaptain Marmot wants to prepare a huge and important battle again原创 2015-05-01 16:18:14 · 1369 阅读 · 0 评论 -
Codeforces Round #305 (Div. 2)- Mike and Fax(分段找回文串)
Mike and Faxtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile Mike was walking in the subway, all the s原创 2015-05-27 16:33:23 · 1794 阅读 · 0 评论 -
Codeforces Round #305 (Div. 2)-Mike and Fun(暴力求解连续1)
Mike and Funtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike and some bears are playing a game just fo原创 2015-05-27 16:37:16 · 1670 阅读 · 0 评论 -
Codeforces Round #303 (Div. 2)(A,B,C,D)
A: 题目地址:Toy Cars 题意:给一个n*n的矩阵,-1只在对角线出现(因为自己不能撞自己),0代表没有车在碰撞,1代表第i辆车(横坐标)被撞坏了,2代表第j辆车(纵坐标)被撞坏了,3代表两辆车都撞坏了。问哪几辆车完好无损。 思路:遍历i。对每一行来说,只要有1和3就代表这辆车跪了,然后只要找出每一行没1和3的就好辣。#include <stdio.h>#include <math.原创 2015-08-08 12:50:23 · 1366 阅读 · 0 评论 -
Codeforces Round #317 [AimFund Thanks-Round] (Div. 2) C(组合数+容斥)
题目地址:Lengthening Sticks 题意:给出a,b,c,L,要求a+x,b+y,c+z构成三角形,x+y+z<=L,问有多少中分法(x,y,z可为0)。 思路:用容斥来搞,结果ans=全部组合的情况-不符合三角形定理的情况。 1.求全部组合的情况: 当L=0时,res=1; 当L=1时,res=3;所以当L=1时形成的情况为1+3=4 当L=2时,res=6;所以当L=2时原创 2015-08-24 14:44:14 · 806 阅读 · 0 评论 -
Codeforces Round #315 -Primes or Palindromes?(回文&&素数)
题目地址:Primes or Palindromes? 题意:给出p,q,A=p/q,求找出最大的n使得n以内的素数的个数<=A*n以内的回文串的个数。 思路:其实就是n以内的素数的个数*q<=n以内的回文串的个数*p。然而p/q的最大值为42,那么数到13000000就到达极限,所以我们直接可以从大的开始往小的一步一步的暴力枚举就可以(感觉窝还是太年轻。。QAQ#include <stdio.原创 2015-08-11 20:26:47 · 1365 阅读 · 0 评论 -
Codeforces Round #315 (Div. 2)(A,B)
A: 题目地址:Music 题意:你要听一首时长为T秒的歌曲, 你点击播放时会立刻下载好S秒, 当你听到没有加载到的地方时, 就会重头听, 直到可以听完整首歌,由于网络堵塞, 你在q秒内只有q-1秒用于下载, 问需要重新多少次(第一次也算) 思路:这个题很类似于初中学过的追及问题。由于每q秒下载的时间为q-1,所以下载的速度可以确定为(q-1)/q。假设需要T秒才能下完,则有公式T*(q-1)原创 2015-08-11 20:18:25 · 1266 阅读 · 0 评论 -
Codeforces Round #315-Codeforces Round #315(贝尔数)
题目地址:New Language 题意:求1到n,n个元素组成的集合中,满足对称性和传递性但不满足自反性的二元组关系集合的个数。 思路:对于每组的对应关系中,正好满足贝尔数(其实是贝尔三角形每行的和) 由图中红框中可以发现上一行的总和=下一行的n-1位置上的数。然后其实上贝尔数的板子就好了。#include <stdio.h>#include <math.h>#include <st原创 2015-08-12 09:11:11 · 1732 阅读 · 0 评论 -
Codeforces Round #316 (Div. 2)(A,B,C)
A: 题目地址:Elections 题意: 一个国家有n个候选人,m个城市,每个城市先投票选出一个候选人,得票多的胜出,得票相同时,下标小的胜出,接着在城市选出的候选人中选出一个胜者,同样是得票相同时,下标小的胜出。 思路:直接模拟一下。#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#i原创 2015-08-14 11:23:13 · 1167 阅读 · 0 评论 -
Codeforces Round #313 (Div. 2)(A,B,C,D)
A题:题目地址:Currency System in Geraldion题意:给出n中货币的面值(每种货币有无数张),要求不能表示出的货币的最小值,若所有面值的都能表示,输出-1.思路:水题,就是看看有没有面值为1的货币,如果有的话,所有面值的货币都可以通过1的累加得到,如果没有的话,最小的不能表示的就当然是1辣。#include #include #include #inc原创 2015-07-23 10:32:42 · 1500 阅读 · 0 评论 -
Codeforces Round #318(Div. 2)(A,B,C,D)
A题: 题目地址:Bear and Elections 题意:最少变换多少次可以使得第一个数字大于后面所有数字。 思路:把后面n-1个数排序,让第一个和最后一个数比较,然后增减。知道第一个数大于最后一个数为止#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#include <iostrea原创 2015-08-30 11:23:49 · 692 阅读 · 1 评论 -
Codeforces Round #Pi (Div. 2)(A,B,C,D)
A题: 题目地址: Lineland Mail#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#include <iostream>#include <sstream>#include <algorithm>#include <set>#include <queue>#include原创 2015-08-07 09:49:58 · 1376 阅读 · 0 评论 -
Codeforces Round #300 - Quasi Binary(贪心)
Quasi BinaryTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA number is called quasibinary if its decimal representation contai原创 2015-05-01 16:25:01 · 1716 阅读 · 0 评论 -
Codeforces Round #300-Tourist's Notes(贪心)
Tourist's NotesTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA tourist hiked along the mountain range. The hike lasted for n原创 2015-05-01 16:26:24 · 1632 阅读 · 0 评论 -
Codeforces Round #289 (Div. 2, ACM ICPC Rules)(A,B)
A. Maximum in Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn n × n table a is defined as follows:原创 2015-02-02 08:19:12 · 1369 阅读 · 0 评论 -
Codeforces Round #290 (Div. 2)(A,B,C)
A. Fox And Snaketime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel starts to learn programming. The原创 2015-02-04 08:10:16 · 1370 阅读 · 0 评论 -
Codeforces Round #292 (Div. 2)(A,B,C)
A. Drazil and Datetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSomeday, Drazil wanted to go on date with原创 2015-02-21 20:16:16 · 1236 阅读 · 0 评论 -
Codeforces Round #291 (Div. 2)(A,B)
A. Chewbaсca and Numbertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLuke Skywalker gave Chewbacca an int原创 2015-02-15 23:58:11 · 1190 阅读 · 0 评论 -
Codeforces Round #287 (Div. 2)(A,B题)
PS:补发,这几天忘记发了。当时被宿舍的渣比网给气哭了,开始二十分钟都没有挤进去,最后没法子搬着电脑黑灯瞎火的去了四楼,sad。做出两道题来,后面的题看懂了,但是由于学艺不精,sad了。A. Amr and Musictime limit per test 1 secondmemory limit per test 256 meg原创 2015-01-26 09:16:00 · 687 阅读 · 2 评论 -
Codeforces Round #295 (Div. 2)(A,B,C)
A. Pangramtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA word or a sentence in some language is called原创 2015-03-04 15:57:36 · 1591 阅读 · 0 评论 -
Codeforces Round #297 (Div. 2) A(模拟)
Vitaliy and Pietime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter a hard day Vitaly got very hungry and原创 2015-03-27 18:47:29 · 1095 阅读 · 0 评论 -
Codeforces Round #297 (Div. 2) C
Ilya and Stickstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the evening, after the contest Ilya was原创 2015-03-27 21:00:50 · 1151 阅读 · 0 评论 -
Codeforces Round #297 (Div. 2) B
Pasha and Stringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPasha got a very beautiful string s for hi原创 2015-03-27 20:06:21 · 1182 阅读 · 0 评论 -
Codeforces Round #296 (Div. 2) B(思维题)
Error Correct Systemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFord Prefect got a job as a web develo原创 2015-03-21 16:28:59 · 1269 阅读 · 0 评论 -
Codeforces Round #296 (Div. 2) C(STL_set)
Glass Carvingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLeonid wants to become a glass carver (the pe原创 2015-03-24 19:31:24 · 1220 阅读 · 0 评论 -
Codeforces Round #300-Cutting Banner(substr函数的应用)
Cutting BannerTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA large banner with word CODEFORCES was ordered for the 1000-th o原创 2015-05-01 16:23:42 · 1900 阅读 · 0 评论 -
Codeforces Round #317 [AimFund Thanks-Round] (Div. 2)(A,B)
A题: 题目地址:Arrays 题意:有两个非递减序列的数组A,B,从A数组中选择k个数,B数组中选择m个数,是否存在A数组选择的k个数小于任意B数组选择的m个数。 思路:选择A数组最后一个数和B数组的第nb-m个数相比较即可。#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h>#includ原创 2015-08-23 13:47:07 · 636 阅读 · 0 评论