Codeforces Round 612 (Div. 1)

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
1286 Codeforces Round 612 (Div. 1) FINISHED False 7200 158946863 Jan. 5, 2020, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 545 ) E Fedya the Potter Strikes Back PROGRAMMING data structures strings 3200

B'Fedya has a string S , initially empty, and an array W , also initially empty. There are n queries to process, one at a time. Query i consists of a lowercase English letter c_i and a nonnegative integer w_i . First, c_i must be appended to S , and w_i must be appended to W . The answer to the query is the sum of suspiciousnesses for all subsegments of W [L, R] , (1 <= q L <= q R <= q i) . We define the suspiciousness of a subsegment as follows: if the substring of S corresponding to this subsegment (that is, a string of consecutive characters from L -th to R -th, inclusive) matches the prefix of S of the same length (that is, a substring corresponding to the subsegment [1, R - L + 1] ), then its suspiciousness is equal to the minimum in the array W on the [L, R] subsegment. Otherwise, in case the substring does not match the corresponding prefix, the suspiciousness is 0 . Help Fedya answer all the queries before the orderlies come for him! The first line contains an integer n (1 <= q n <= q 600 ,000) -- the number of queries. The i -th of the following n lines contains the query i : a lowercase letter of the Latin alphabet c_i and an integer w_i (0 <= q w_i <= q 2^{30} - 1) . All queries are given in an encrypted form. Let ans be the answer to the previous query (for the first query we set this value equal to 0 ). Then, in order to get the real query, you need to do the following: perform a cyclic shift of c_i in the alphabet forward by ans , and set w_i equal to w_i oplus (ans & MASK) , where oplus is the bitwise exclusive "or", & is the bitwise "and", and MASK = 2^{30} - 1 . Print n lines, i -th line should contain a single integer -- the answer to the i -th query. For convenience, we will call "suspicious" those su'...

Tutorials

Codeforces Round #612 - Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
69459637 luogu_bot4 E Jan. 24, 2020, 10:08 a.m. OK GNU C++11 TESTS 190 560 24678400 3200
69425089 gongsuidashen E Jan. 23, 2020, 3:33 p.m. OK GNU C++11 TESTS 190 560 24678400 3200
68628658 zx2003 E Jan. 12, 2020, 1:03 a.m. OK GNU C++11 TESTS 190 670 77619200 3200
68589901 cuizhuyefei E Jan. 11, 2020, 12:21 p.m. OK GNU C++11 TESTS 190 733 38092800 3200
69176162 _twilight E Jan. 20, 2020, 8:12 a.m. OK GNU C++11 TESTS 190 779 191180800 3200
68316677 XLor E Jan. 6, 2020, 1:28 p.m. OK GNU C++11 TESTS 189 904 49254400 3200
68425887 WZYYN E Jan. 9, 2020, 3:12 a.m. OK GNU C++11 TESTS 190 1091 63078400 3200
68452967 georgerapeanu E Jan. 9, 2020, 3:01 p.m. OK GNU C++11 TESTS 190 2215 84787200 3200
68281607 Benq E Jan. 5, 2020, 5:14 p.m. OK GNU C++14 TESTS 189 670 81510400 3200
68566810 TadijaSebez E Jan. 10, 2020, 9:58 p.m. OK GNU C++14 TESTS 190 685 29696000 3200
69190549 ffffxk E Jan. 20, 2020, 1:22 p.m. OK GNU C++14 TESTS 190 717 82636800 3200
68833996 newbiegcz E Jan. 15, 2020, 1:36 a.m. OK GNU C++14 TESTS 190 857 63180800 3200
68620157 BSBandme E Jan. 11, 2020, 7:13 p.m. OK GNU C++14 TESTS 190 888 106496000 3200
68277312 ainta E Jan. 5, 2020, 4:01 p.m. OK GNU C++14 TESTS 1 951 92057600 3200
68542754 17wh1a0577 E Jan. 10, 2020, 3:42 p.m. OK GNU C++14 TESTS 190 1029 29184000 3200
69261683 furious_beast E Jan. 21, 2020, 5:15 p.m. OK GNU C++14 TESTS 190 1169 121958400 3200
68434599 jijiang E Jan. 9, 2020, 8:26 a.m. OK GNU C++14 TESTS 190 1216 212889600 3200
68962374 yasugongshang E Jan. 17, 2020, 2:13 a.m. OK GNU C++14 TESTS 190 1591 42803200 3200
69421845 gongsuidashen E Jan. 23, 2020, 2:38 p.m. OK GNU C++17 TESTS 190 561 24678400 3200
69420958 gongsuidashen E Jan. 23, 2020, 2:23 p.m. OK GNU C++17 TESTS 190 576 24678400 3200
68338305 neal E Jan. 7, 2020, 12:45 a.m. OK GNU C++17 TESTS 190 576 24678400 3200
68568997 kczno1 E Jan. 11, 2020, 12:28 a.m. OK GNU C++17 TESTS 190 717 12595200 3200
68485018 jiangly E Jan. 10, 2020, 9:20 a.m. OK GNU C++17 TESTS 190 795 31846400 3200
68303699 yosupo E Jan. 6, 2020, 8:02 a.m. OK GNU C++17 TESTS 189 795 86220800 3200
68484885 jiangly E Jan. 10, 2020, 9:17 a.m. OK GNU C++17 TESTS 190 810 31846400 3200
68338146 neal E Jan. 7, 2020, 12:31 a.m. OK GNU C++17 TESTS 190 842 29184000 3200
68412532 ngfam E Jan. 8, 2020, 5:33 p.m. OK GNU C++17 TESTS 190 873 34508800 3200
68338052 neal E Jan. 7, 2020, 12:24 a.m. OK GNU C++17 TESTS 190 888 29286400 3200
68608221 r57shell E Jan. 11, 2020, 2:46 p.m. OK MS C++ TESTS 190 920 33075200 3200
68600427 r57shell E Jan. 11, 2020, 1:57 p.m. OK MS C++ TESTS 190 966 95641600 3200
68606526 r57shell E Jan. 11, 2020, 2:20 p.m. OK MS C++ TESTS 190 967 33075200 3200

remove filters

Back to search problems