随笔分类 -  Codeforces

摘要:A. Array Balancing You are given two arrays of length nn: a1,a2,…,ana1,a2,…,an and b1,b2,…,bnb1,b2,…,bn. You can perform the following operation any n 阅读全文
posted @ 2022-04-11 17:36 HazelNuto 阅读(79) 评论(0) 推荐(0) 编辑
摘要:把字符串看作是26进制的数,从后往前翻译,那么就可以把两个串变成对应的26进制的数字,那么只要把两个数加起来除以二就得到中间的串对应的数了,同理再转化回来就行了。但是这样会有一个问题就是串的长度有2e5,26的2e5次方显然不可求,所以需要对每一位进行手动的加和运算。对于两个串,我们假设a串从后往前 阅读全文
posted @ 2019-04-01 00:55 HazelNuto 阅读(303) 评论(3) 推荐(1) 编辑
摘要:You are given a tree (a connected undirected graph without cycles) of 𝑛n vertices. Each of the 𝑛−1n−1 edges of the tree is colored in either black o 阅读全文
posted @ 2019-03-23 13:11 HazelNuto 阅读(343) 评论(0) 推荐(0) 编辑
摘要:You went to the store, selling 𝑛n types of chocolates. There are 𝑎𝑖ai chocolates of type 𝑖i in stock. You have unlimited amount of cash (so you ar 阅读全文
posted @ 2019-03-23 13:02 HazelNuto 阅读(298) 评论(0) 推荐(0) 编辑
摘要:You are given a string 𝑠=𝑠1𝑠2…𝑠𝑛s=s1s2…sn of length 𝑛n, which only contains digits 11, 22, ..., 99. A substring 𝑠[𝑙…𝑟]s[l…r] of 𝑠s is a stri 阅读全文
posted @ 2019-03-23 12:57 HazelNuto 阅读(234) 评论(0) 推荐(0) 编辑
摘要:E. Superhero Battle A superhero fights with a monster. The battle consists of rounds, each of which lasts exactly 𝑛n minutes. After a round ends, the 阅读全文
posted @ 2019-03-22 15:23 HazelNuto 阅读(321) 评论(0) 推荐(0) 编辑
摘要:Rick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy to Morty before bad 阅读全文
posted @ 2019-01-21 23:19 HazelNuto 阅读(194) 评论(0) 推荐(0) 编辑
摘要:C. Ayoub and Lost Array Ayoub had an array 𝑎 of integers of size 𝑛 and this array had two interesting properties: All the integers in the array were 阅读全文
posted @ 2019-01-21 12:28 HazelNuto 阅读(420) 评论(0) 推荐(0) 编辑
摘要:Ralph is going to collect mushrooms in the Mushroom Forest. There are m directed paths connecting n trees in the Mushroom Forest. On each path grow so 阅读全文
posted @ 2018-04-16 09:04 HazelNuto 阅读(250) 评论(0) 推荐(0) 编辑
摘要:Let's call a string adorable if its letters can be realigned in such a way that they form two consequent groups of equal symbols (note that different 阅读全文
posted @ 2018-03-24 21:49 HazelNuto 阅读(607) 评论(0) 推荐(0) 编辑
摘要:After waking up at hh:mm, Andrew realised that he had forgotten to feed his only cat for yet another time (guess why there's only one cat). The cat's 阅读全文
posted @ 2018-03-24 19:20 HazelNuto 阅读(419) 评论(0) 推荐(0) 编辑
摘要:In Arcady's garden there grows a peculiar apple-tree that fruits one time per year. Its peculiarity can be explained in following way: there are n inf 阅读全文
posted @ 2018-03-22 10:36 HazelNuto 阅读(161) 评论(0) 推荐(0) 编辑
摘要:Anya and Kirill are doing a physics laboratory work. In one of the tasks they have to measure some value n times, and then compute the average value t 阅读全文
posted @ 2018-03-22 08:20 HazelNuto 阅读(238) 评论(0) 推荐(0) 编辑
摘要:The last stage of Football World Cup is played using the play-off system. There are n teams left in this stage, they are enumerated from 1 to n. Sever 阅读全文
posted @ 2018-03-22 08:15 HazelNuto 阅读(221) 评论(0) 推荐(0) 编辑
摘要:Two friends are on the coordinate axis Ox in points with integer coordinates. One of them is in the point x1 = a, another one is in the point x2 = b. 阅读全文
posted @ 2018-03-22 08:10 HazelNuto 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Alice and Bob begin their day with a quick game. They first choose a starting number X0 ≥ 3 and try to reach one million by the process described belo 阅读全文
posted @ 2018-03-20 21:46 HazelNuto 阅读(213) 评论(0) 推荐(0) 编辑
摘要:http://codeforces.com/contest/948/problem/C C. Producing Snow Alice likes snow a lot! Unfortunately, this year's winter is already over, and she can't 阅读全文
posted @ 2018-03-11 11:15 HazelNuto 阅读(262) 评论(0) 推荐(0) 编辑
摘要:http://codeforces.com/contest/948/problem/A A. Protect Sheep Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of th 阅读全文
posted @ 2018-03-11 11:02 HazelNuto 阅读(435) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示