Codeforces Round 316 (Div. 2)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
570 Codeforces Round 316 (Div. 2) FINISHED False 7200 292339799 Aug. 13, 2015, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9185 ) C Replacement PROGRAMMING constructive algorithms data structures implementation 1600

B'Daniel has a string s, consisting of lowercase English letters and period signs (characters '. '). Let 's define the operation of replacement as the following sequence of steps: find a substring ".." (two consecutive periods) in string s, of all occurrences of the substring let 's choose the first one, and replace this substring with string ".". In other words, during the replacement operation, the first two consecutive periods are replaced by one. If string s contains no two consecutive periods, then nothing happens. Let 's define f(s) as the minimum number of operations of replacement to perform, so that the string does not have any two consecutive periods left. You need to process m queries, the i-th results in that the character at position xi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) of string s is assigned value ci. After each operation you have to calculate and output the value of f(s). Help Daniel to process all queries. The first line contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89300 xe2 x80 x89000) the length of the string and the number of queries. The second line contains string s, consisting of n lowercase English letters and period signs. The following m lines contain the descriptions of queries. The i-th line contains integer xi and ci (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, ci -- a lowercas English letter or a period sign), describing the query of assigning symbol ci to position xi. Print m numbers, one per line, the i-th of these numbers must be equal to the value of f(s) after performing the i-th assignment. Note to the first sample test (replaced periods are enclosed in square brackets). The original string is ".b..bz....". Note to the second sample test. The original string is ".cc.".'...

Tutorials

Codeforces Round #316 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
17030743 favstovol C March 30, 2016, 9:08 a.m. OK Delphi TESTS 50 156 307200 1600
14262620 vjudge5 C Nov. 15, 2015, 2:05 a.m. OK FPC TESTS 50 561 1331200 1600
14137872 Gray_58 C Nov. 8, 2015, 8:38 a.m. OK FPC TESTS 50 607 512000 1600
15041309 tinnt C Dec. 27, 2015, 9:22 a.m. OK FPC TESTS 50 607 1331200 1600
15135286 DMHung C Dec. 31, 2015, 10:20 a.m. OK FPC TESTS 50 607 2867200 1600
15152848 fivut C Jan. 1, 2016, 8:30 p.m. OK FPC TESTS 50 608 307200 1600
15063898 tinnt C Dec. 28, 2015, 2:25 a.m. OK FPC TESTS 50 608 1331200 1600
15146937 zero1778 C Jan. 1, 2016, 10:11 a.m. OK FPC TESTS 50 623 307200 1600
13949169 Ruby_Ocelot C Oct. 30, 2015, 9:03 a.m. OK FPC TESTS 50 623 1331200 1600
15978573 Andrey15253545 C Feb. 12, 2016, 9:26 p.m. OK FPC TESTS 50 623 1843200 1600
13541564 vjudge2 C Oct. 11, 2015, 6:39 a.m. OK FPC TESTS 50 655 512000 1600
27389073 Junkesh C May 27, 2017, 1:03 p.m. OK GNU C TESTS 50 171 307200 1600
18608138 Rizro C June 20, 2016, 3:08 a.m. OK GNU C TESTS 50 171 307200 1600
17272479 yigezhe C April 11, 2016, 12:09 a.m. OK GNU C TESTS 50 171 307200 1600
13948646 LYDing C Oct. 30, 2015, 8:27 a.m. OK GNU C TESTS 50 171 307200 1600
13920457 Sajid_Hasan_Apon C Oct. 28, 2015, 5:53 p.m. OK GNU C TESTS 50 171 307200 1600
13770942 pikmike C Oct. 21, 2015, 12:11 p.m. OK GNU C TESTS 50 171 307200 1600
13347198 dhruvtanwar C Oct. 2, 2015, 4:59 p.m. OK GNU C TESTS 50 171 307200 1600
22903521 nitesh_gupta C Dec. 12, 2016, 12:22 p.m. OK GNU C TESTS 50 186 307200 1600
35165018 rainboy C Feb. 11, 2018, 10:46 p.m. OK GNU C TESTS 50 186 2150400 1600
26046631 us03385 C April 1, 2017, 8:03 a.m. OK GNU C TESTS 50 186 3481600 1600
23834143 vjudge2 C Jan. 15, 2017, 9:10 a.m. OK GNU C++ TESTS 50 108 2150400 1600
40513543 vjudge1 C July 18, 2018, 12:15 p.m. OK GNU C++ TESTS 50 109 307200 1600
40513511 txytyun C July 18, 2018, 12:14 p.m. OK GNU C++ TESTS 50 109 307200 1600
16464313 MagHSKisAFO C March 2, 2016, 12:30 p.m. OK GNU C++ TESTS 50 109 1024000 1600
13763950 unknown_shadow C Oct. 21, 2015, 12:33 a.m. OK GNU C++ TESTS 50 140 102400 1600
19861498 vjudge2 C Aug. 14, 2016, 2:46 a.m. OK GNU C++ TESTS 50 140 2355200 1600
15028091 alexislacour C Dec. 26, 2015, 8:04 a.m. OK GNU C++ TESTS 50 155 2048000 1600
21403493 Cydiater C Oct. 13, 2016, 12:59 p.m. OK GNU C++ TESTS 50 155 3072000 1600
19394069 vjudge1 C July 25, 2016, 4:16 a.m. OK GNU C++ TESTS 50 156 102400 1600
15507038 vjudge2 C Jan. 23, 2016, 4:04 a.m. OK GNU C++ TESTS 50 156 102400 1600
55061309 patilc125 C June 3, 2019, 11:04 p.m. OK GNU C11 TESTS 50 1107 1024000 1600
58235453 Sarica C Aug. 3, 2019, 7:14 p.m. OK GNU C11 TESTS 50 1107 2969600 1600
58235119 hejbro C Aug. 3, 2019, 7:02 p.m. OK GNU C11 TESTS 50 1107 2969600 1600
13770946 pikmike C Oct. 21, 2015, 12:11 p.m. OK GNU C11 TESTS 50 1169 307200 1600
40986261 ReaLNero1 C July 30, 2018, 8:27 p.m. OK GNU C++11 TESTS 50 62 307200 1600
24805683 zura1547 C Feb. 19, 2017, 3:46 p.m. OK GNU C++11 TESTS 50 77 2355200 1600
52259643 gn_wz C April 3, 2019, 8:01 a.m. OK GNU C++11 TESTS 50 93 307200 1600
61883546 vjudge4 C Oct. 5, 2019, 2 a.m. OK GNU C++11 TESTS 50 93 409600 1600
61883478 DXTL666 C Oct. 5, 2019, 1:57 a.m. OK GNU C++11 TESTS 50 93 409600 1600
66786851 luogu_bot4 C Dec. 13, 2019, 1:57 p.m. OK GNU C++11 TESTS 50 124 307200 1600
64450829 oh_yes C Nov. 7, 2019, 7:01 a.m. OK GNU C++11 TESTS 50 139 307200 1600
66677347 _shiroi C Dec. 12, 2019, 11:51 a.m. OK GNU C++11 TESTS 50 140 307200 1600
66787575 luogu_bot3 C Dec. 13, 2019, 2:11 p.m. OK GNU C++11 TESTS 50 140 307200 1600
19943818 Corvus C Aug. 18, 2016, 10:01 a.m. OK GNU C++11 TESTS 50 140 2355200 1600
45698224 greenblade C Nov. 14, 2018, 6 a.m. OK GNU C++14 TESTS 50 140 307200 1600
32137826 Ayazbayev_D C Nov. 8, 2017, 11:33 a.m. OK GNU C++14 TESTS 50 140 1024000 1600
27508631 Quinas C June 1, 2017, 6:49 p.m. OK GNU C++14 TESTS 50 140 1024000 1600
33905818 YouKn0wWho C Jan. 4, 2018, 3:15 p.m. OK GNU C++14 TESTS 50 140 2867200 1600
33982800 Alden C Jan. 7, 2018, 12:41 p.m. OK GNU C++14 TESTS 50 140 2969600 1600
48368462 gfonn C Jan. 14, 2019, 1:35 a.m. OK GNU C++14 TESTS 50 155 307200 1600
65581307 Scut82 C Nov. 23, 2019, 11:06 a.m. OK GNU C++14 TESTS 50 155 307200 1600
62452995 SharifHossen C Oct. 13, 2019, 5:12 a.m. OK GNU C++14 TESTS 50 155 307200 1600
51335269 thebest4iu C March 15, 2019, 1:54 p.m. OK GNU C++14 TESTS 50 155 307200 1600
48425192 ChimengSoso C Jan. 15, 2019, 2:34 p.m. OK GNU C++14 TESTS 50 155 307200 1600
61358596 vjudge5 C Sept. 27, 2019, 11:24 a.m. OK GNU C++17 TESTS 50 155 307200 1600
64452215 xxyu C Nov. 7, 2019, 7:30 a.m. OK GNU C++17 TESTS 50 155 614400 1600
44665910 jnk C Oct. 21, 2018, 5:52 p.m. OK GNU C++17 TESTS 50 155 614400 1600
50513940 wronganswer C Feb. 26, 2019, 4:40 a.m. OK GNU C++17 TESTS 50 155 1024000 1600
61896569 pubfso C Oct. 5, 2019, 7:24 a.m. OK GNU C++17 TESTS 50 155 1024000 1600
56554543 mustafa9900 C July 5, 2019, 11:44 a.m. OK GNU C++17 TESTS 50 155 1024000 1600
56398588 amitdu6ey C July 1, 2019, 3:46 p.m. OK GNU C++17 TESTS 50 155 1024000 1600
53462365 Moaz_Basheer C April 28, 2019, 8:02 a.m. OK GNU C++17 TESTS 50 155 1024000 1600
49071157 __REXX__ C Jan. 27, 2019, 8:53 p.m. OK GNU C++17 TESTS 50 155 1331200 1600
64317103 Zihad_Bd C Nov. 5, 2019, 2:26 p.m. OK GNU C++17 TESTS 50 156 307200 1600
13731306 Eeyore C Oct. 19, 2015, 3:53 p.m. OK Go TESTS 50 686 1228800 1600
13731267 Eeyore C Oct. 19, 2015, 3:51 p.m. OK Go TESTS 50 717 1228800 1600
13246492 ptorstyle_new C Sept. 27, 2015, 8:44 a.m. OK Go TESTS 50 1138 2457600 1600
15564190 behzad.nouri C Jan. 24, 2016, 10:48 p.m. OK Haskell TESTS 50 374 67379200 1600
15564028 behzad.nouri C Jan. 24, 2016, 10:24 p.m. OK Haskell TESTS 50 452 70553600 1600
26450885 SirNickolas C April 17, 2017, 9:46 a.m. OK Haskell TESTS 50 889 84992000 1600
28019272 karlm C June 25, 2017, 9:30 a.m. OK Haskell TESTS 50 1387 176332800 1600
68950194 bharath C Jan. 16, 2020, 5:40 p.m. OK Java 11 TESTS 50 343 0 1600
16989551 stolis C March 28, 2016, 3:35 p.m. OK Java 7 TESTS 50 171 44851200 1600
14050200 DukeOfYork C Nov. 4, 2015, 1:09 a.m. OK Java 7 TESTS 50 187 0 1600
14050099 DukeOfYork C Nov. 4, 2015, 12:48 a.m. OK Java 7 TESTS 50 187 0 1600
13596477 snrahul C Oct. 13, 2015, 4:52 p.m. OK Java 7 TESTS 50 233 0 1600
17380031 lebaur C April 18, 2016, 6:36 p.m. OK Java 7 TESTS 50 249 39321600 1600
14919395 xiaowuc1 C Dec. 21, 2015, 11:32 p.m. OK Java 7 TESTS 50 264 0 1600
16697611 Nirmit C March 13, 2016, 2:55 p.m. OK Java 7 TESTS 50 265 0 1600
18206443 zodiacleo C June 1, 2016, 9:41 p.m. OK Java 7 TESTS 50 280 39321600 1600
17806393 IsAmAre C May 8, 2016, 10:56 a.m. OK Java 7 TESTS 50 295 39424000 1600
17827824 anuj64 C May 10, 2016, 6:11 a.m. OK Java 7 TESTS 50 296 39321600 1600
16505109 megaspazz C March 4, 2016, 12:13 a.m. OK Java 8 TESTS 50 202 0 1600
57126643 Seco_seco C July 16, 2019, 4:53 a.m. OK Java 8 TESTS 50 202 0 1600
48593193 chojh1222 C Jan. 20, 2019, 4:33 a.m. OK Java 8 TESTS 50 202 0 1600
17807460 t8m8 C May 8, 2016, 12:15 p.m. OK Java 8 TESTS 50 202 20480000 1600
17823161 cohadar C May 9, 2016, 4:55 p.m. OK Java 8 TESTS 50 202 26214400 1600
59112792 T_Nady C Aug. 19, 2019, 10:22 p.m. OK Java 8 TESTS 50 217 0 1600
27347397 Bibhuti C May 26, 2017, 2:23 a.m. OK Java 8 TESTS 50 218 0 1600
68070332 kraken7 C Jan. 2, 2020, 9:59 a.m. OK Java 8 TESTS 50 218 3686400 1600
38654519 kanak893 C May 27, 2018, 11:52 a.m. OK Java 8 TESTS 50 233 0 1600
22102504 HIT_MAN C Nov. 7, 2016, 9:38 p.m. OK Java 8 TESTS 50 233 0 1600
13882618 dr.ikros C Oct. 27, 2015, 1:59 a.m. OK JavaScript TESTS 50 498 22732800 1600
16905305 Kero C March 24, 2016, 11:49 a.m. OK JavaScript TESTS 50 795 15769600 1600
13310931 itytwt C Sept. 30, 2015, 9:05 a.m. OK JavaScript TESTS 50 1154 24780800 1600
13310196 itytwt C Sept. 30, 2015, 7:53 a.m. OK JavaScript TESTS 50 1201 24166400 1600
13882606 dr.ikros C Oct. 27, 2015, 1:56 a.m. OK JavaScript TESTS 50 1715 16281600 1600
54350951 hibatibati C May 18, 2019, 2:48 p.m. OK Mono C# TESTS 50 280 23244800 1600
45227597 Skndr801 C Nov. 3, 2018, 4:48 a.m. OK Mono C# TESTS 50 296 48640000 1600
36933358 jjaredsimpson C April 3, 2018, 8:20 p.m. OK Mono C# TESTS 50 1543 11571200 1600
36966241 jjaredsimpson C April 4, 2018, 3:08 p.m. OK Mono C# TESTS 50 1590 11673600 1600
36995379 coder2213 C April 5, 2018, 11:14 a.m. OK Mono C# TESTS 50 1637 47718400 1600
36933062 jjaredsimpson C April 3, 2018, 8:05 p.m. OK Mono C# TESTS 50 1684 11673600 1600
44561428 nemars C Oct. 19, 2018, 7:48 p.m. OK Mono C# TESTS 50 1996 7884800 1600
17991542 camypaper C May 19, 2016, 1:14 p.m. OK MS C# TESTS 50 139 13312000 1600
15987525 m1_k3 C Feb. 13, 2016, 1:02 p.m. OK MS C# TESTS 50 280 19558400 1600
15987543 m1_k3 C Feb. 13, 2016, 1:04 p.m. OK MS C# TESTS 50 296 19660800 1600
28915423 Phortox C July 26, 2017, 10:02 p.m. OK MS C# TESTS 50 1481 13516800 1600
27709461 Sorryforpartyrocking C June 10, 2017, 4:20 p.m. OK MS C# TESTS 50 1513 4300800 1600
28915397 Phortox C July 26, 2017, 9:59 p.m. OK MS C# TESTS 50 1559 13516800 1600
15987481 m1_k3 C Feb. 13, 2016, 12:59 p.m. OK MS C# TESTS 50 1590 7270400 1600
13351925 _piyush C Oct. 3, 2015, 2:09 a.m. OK MS C# TESTS 50 1591 5529600 1600
14857148 gnihton C Dec. 18, 2015, 6:16 a.m. OK MS C# TESTS 50 1606 12083200 1600
20301717 Chubcheg C Aug. 31, 2016, 11:21 a.m. OK MS C# TESTS 50 1622 8499200 1600
45385018 vjudge5 C Nov. 6, 2018, 5:04 p.m. OK MS C++ TESTS 50 155 307200 1600
64561287 vjudge3 C Nov. 9, 2019, 6:08 a.m. OK MS C++ TESTS 50 155 307200 1600
64183708 vjudge2 C Nov. 4, 2019, 3:15 a.m. OK MS C++ TESTS 50 156 307200 1600
64533121 vjudge4 C Nov. 8, 2019, 4:04 p.m. OK MS C++ TESTS 50 156 307200 1600
19360112 ONCE C July 23, 2016, 8:25 a.m. OK MS C++ TESTS 50 156 409600 1600
64553231 vjudge5 C Nov. 9, 2019, 1:35 a.m. OK MS C++ TESTS 50 171 307200 1600
51155692 vjudge2 C March 11, 2019, 10:34 a.m. OK MS C++ TESTS 50 171 307200 1600
62912842 vjudge1 C Oct. 19, 2019, 7:50 a.m. OK MS C++ TESTS 50 171 307200 1600
63240379 vjudge2 C Oct. 23, 2019, 1:18 p.m. OK MS C++ TESTS 50 171 307200 1600
64528095 vjudge5 C Nov. 8, 2019, 2:27 p.m. OK MS C++ TESTS 50 171 307200 1600
64559219 vjudge3 C Nov. 9, 2019, 5:22 a.m. OK MS C++ 2017 TESTS 50 202 307200 1600
54055423 zhuiyi C May 13, 2019, 7:52 a.m. OK MS C++ 2017 TESTS 50 202 307200 1600
60150920 nuchenghao C Sept. 6, 2019, 3:57 a.m. OK MS C++ 2017 TESTS 50 218 307200 1600
61451352 _wxyz C Sept. 29, 2019, 3:05 a.m. OK MS C++ 2017 TESTS 50 249 307200 1600
61884454 vjudge4 C Oct. 5, 2019, 2:36 a.m. OK MS C++ 2017 TESTS 50 358 9932800 1600
49493827 PavelChadnov C Feb. 5, 2019, 11:43 a.m. OK MS C++ 2017 TESTS 50 1450 921600 1600
59636170 areo C Aug. 28, 2019, 8:50 p.m. OK MS C++ 2017 TESTS 50 1450 921600 1600
65282822 yuanyuan2048 C Nov. 18, 2019, 6:49 a.m. OK MS C++ 2017 TESTS 50 1466 921600 1600
65038481 felix412441 C Nov. 15, 2019, 12:33 p.m. OK MS C++ 2017 TESTS 50 1513 921600 1600
63120331 vjudge5 C Oct. 22, 2019, 10:59 a.m. OK MS C++ 2017 TESTS 50 1513 1024000 1600
13721597 DarthShrine C Oct. 19, 2015, 4:25 a.m. OK Ocaml TESTS 50 327 3788800 1600
13721607 DarthShrine C Oct. 19, 2015, 4:26 a.m. OK Ocaml TESTS 50 1013 10035200 1600
14021930 mirs C Nov. 2, 2015, 11:48 a.m. OK PyPy 2 TESTS 50 1076 31232000 1600
65760218 Mohamed_Ayman C Nov. 26, 2019, 3:33 p.m. OK PyPy 3 TESTS 50 826 35225600 1600
68760287 gaidash C Jan. 14, 2020, 8:34 a.m. OK PyPy 3 TESTS 50 857 35635200 1600
65760346 Mohamed_Ayman C Nov. 26, 2019, 3:35 p.m. OK PyPy 3 TESTS 50 858 68710400 1600
56644881 Mr.Inconsistent C July 7, 2019, 5:44 a.m. OK PyPy 3 TESTS 50 982 19558400 1600
59969608 vjudge5 C Sept. 3, 2019, 11:37 p.m. OK PyPy 3 TESTS 50 1014 36352000 1600
65574619 Just_a_game_on_your_lips C Nov. 23, 2019, 8:58 a.m. OK PyPy 3 TESTS 50 1216 11264000 1600
32142189 nonis C Nov. 8, 2017, 3:17 p.m. OK PyPy 3 TESTS 50 1825 18124800 1600
55835504 enchantedpudding C June 20, 2019, 3:08 p.m. OK Python 2 TESTS 50 888 6348800 1600
13143625 diegoado C Sept. 22, 2015, 4:19 p.m. OK Python 2 TESTS 50 904 2867200 1600
13429810 nyyborn C Oct. 6, 2015, 10:04 a.m. OK Python 2 TESTS 50 950 21708800 1600
27448134 i_m_sanjog C May 30, 2017, 12:31 p.m. OK Python 2 TESTS 50 1013 1843200 1600
13351365 alvinlao C Oct. 3, 2015, 12:12 a.m. OK Python 2 TESTS 50 1013 2150400 1600
50566418 ashok123 C Feb. 27, 2019, 1:20 p.m. OK Python 2 TESTS 50 1013 6246400 1600
23287671 2390_ C Dec. 25, 2016, 8:50 a.m. OK Python 2 TESTS 50 1013 12902400 1600
33371572 ytz123 C Dec. 18, 2017, 7:43 a.m. OK Python 2 TESTS 50 1029 10854400 1600
16748554 jairNeto C March 16, 2016, 3:44 p.m. OK Python 2 TESTS 50 1044 7577600 1600
16773549 claramm C March 17, 2016, 11:34 p.m. OK Python 2 TESTS 50 1060 2867200 1600
15598957 surokpro C Jan. 26, 2016, 5:56 p.m. OK Python 3 TESTS 50 935 16691200 1600
50087096 augurar C Feb. 18, 2019, 8:08 a.m. OK Python 3 TESTS 50 935 35840000 1600
54071918 Bilawal C May 13, 2019, 4:49 p.m. OK Python 3 TESTS 50 1044 24473600 1600
26137913 fenozipam Kucheriava C April 5, 2017, 7:47 a.m. OK Python 3 TESTS 50 1107 29798400 1600
15772612 akim C Feb. 3, 2016, 3:54 p.m. OK Python 3 TESTS 50 1154 36966400 1600
69694531 Mohammed_Almasry C Jan. 28, 2020, 7:52 p.m. OK Python 3 TESTS 50 1169 21913600 1600
69694315 Mohammed_Almasry C Jan. 28, 2020, 7:48 p.m. OK Python 3 TESTS 50 1200 21913600 1600
14040437 atzaruri C Nov. 3, 2015, 11:04 a.m. OK Python 3 TESTS 50 1201 23244800 1600
15772580 akim C Feb. 3, 2016, 3:53 p.m. OK Python 3 TESTS 50 1201 23552000 1600
20325384 guzhoudiaoke C Sept. 1, 2016, 3:32 p.m. OK Python 3 TESTS 50 1216 23449600 1600
24403662 hogeover30 C Feb. 3, 2017, 6:51 a.m. OK Ruby TESTS 50 701 111206400 1600
24403617 hogeover30 C Feb. 3, 2017, 6:48 a.m. OK Ruby TESTS 50 858 110796800 1600
15269214 ditsing C Jan. 9, 2016, 12:11 p.m. OK Ruby TESTS 50 1575 819200 1600
15269197 ditsing C Jan. 9, 2016, 12:09 p.m. OK Ruby TESTS 50 1903 819200 1600
15278203 Hankai C Jan. 10, 2016, 9:18 a.m. OK Ruby TESTS 50 1964 172748800 1600

remove filters

Back to search problems