Codeforces Round 616 (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
1290 Codeforces Round 616 (Div. 1) FINISHED False 9000 156700511 Feb. 2, 2020, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1845 ) C Prefix Enlightenment PROGRAMMING dfs and similar ds graphs 2400

B"There are n lamps on a line, numbered from 1 to n . Each one has an initial state off ( 0 ) or on ( 1 ). You're given k subsets A_1, ldots, A_k of {1, 2, ... , n } , such that the intersection of any three subsets is empty. In other words, for all 1 <= i_1 < i_2 < i_3 <= k , A_{i_1} cap A_{i_2} cap A_{i_3} = varnothing . In one operation, you can choose one of these k subsets and switch the state of all lamps in it. It is guaranteed that, with the given subsets, it's possible to make all lamps be simultaneously on using this type of operation. Let m_i be the minimum number of operations you have to do in order to make the i first lamps be simultaneously on. Note that there is no condition upon the state of other lamps (between i+1 and n ), they can be either off or on. You have to compute m_i for all 1 <= i <= n . The first line contains two integers n and k ( 1 <= n, k <= 3 cdot 10^5 ). The second line contains a binary string of length n , representing the initial state of each lamp (the lamp i is off if s_i = 0 , on if s_i = 1 ). The description of each one of the k subsets follows, in the following format: The first line of the description contains a single integer c ( 1 <= c <= n ) -- the number of elements in the subset. The second line of the description contains c distinct integers x_1, ldots, x_c ( 1 <= x_i <= n ) -- the elements of the subset. It is guaranteed that: You must output n lines. The i -th line should contain a single integer m_i -- the minimum number of operations required to make the lamps 1 to i be simultaneously on. In the first example: In the second example: "...

Tutorials

Codeforces Round #616 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
70077253 Gassa C Feb. 2, 2020, 4:05 p.m. OK D TESTS 20 857 73420800 2400
70058952 hos.lyric C Feb. 2, 2020, 3 p.m. OK D TESTS 20 998 56422400 2400
70080203 physics0523 C Feb. 2, 2020, 4:17 p.m. OK GNU C11 TESTS 20 1231 21504000 2400
70077612 disangan233 C Feb. 2, 2020, 4:06 p.m. OK GNU C++11 TESTS 20 93 18329600 2400
70068379 LJC00118 C Feb. 2, 2020, 3:30 p.m. OK GNU C++11 TESTS 20 109 13516800 2400
70157360 xblakioi C Feb. 3, 2020, 2:23 p.m. OK GNU C++11 TESTS 20 124 9113600 2400
70438013 zyn_615 C Feb. 6, 2020, 1:21 p.m. OK GNU C++11 TESTS 20 124 15360000 2400
70204995 Binary_Search_Tree C Feb. 4, 2020, 6:01 a.m. OK GNU C++11 TESTS 20 124 24064000 2400
70830324 stal_xy23z7b8 C Feb. 12, 2020, 8:10 a.m. OK GNU C++11 TESTS 20 155 9932800 2400
70119908 shuashuawan C Feb. 3, 2020, 8:22 a.m. OK GNU C++11 TESTS 20 155 16998400 2400
70062682 stal_xy23z7b8 C Feb. 2, 2020, 3:11 p.m. OK GNU C++11 TESTS 20 171 9932800 2400
70214446 nantf C Feb. 4, 2020, 9:17 a.m. OK GNU C++11 TESTS 20 171 11161600 2400
70960968 luogu_bot1 C Feb. 13, 2020, 2:12 p.m. OK GNU C++11 TESTS 20 186 9932800 2400
70115563 TAISA_ C Feb. 3, 2020, 7:04 a.m. OK GNU C++14 TESTS 20 311 9420800 2400
70062608 wucstdio C Feb. 2, 2020, 3:11 p.m. OK GNU C++14 TESTS 20 327 8089600 2400
70234500 Mackerel_Pike C Feb. 4, 2020, 1:17 p.m. OK GNU C++14 TESTS 20 342 14745600 2400
70208802 guyan C Feb. 4, 2020, 7:27 a.m. OK GNU C++14 TESTS 20 343 7577600 2400
70120158 xiayuyang C Feb. 3, 2020, 8:26 a.m. OK GNU C++14 TESTS 20 343 49049600 2400
70063548 laekov_ C Feb. 2, 2020, 3:14 p.m. OK GNU C++14 TESTS 20 358 8704000 2400
70565988 lfw C Feb. 8, 2020, 1:12 p.m. OK GNU C++14 TESTS 20 358 8704000 2400
70114932 HanZhongBalls C Feb. 3, 2020, 6:50 a.m. OK GNU C++14 TESTS 20 358 22425600 2400
70074263 Hell_Eclipse C Feb. 2, 2020, 3:53 p.m. OK GNU C++14 TESTS 20 374 37580800 2400
70090225 fjuengermann C Feb. 2, 2020, 6:09 p.m. OK GNU C++14 TESTS 20 374 52428800 2400
70062294 JOHNKRAM C Feb. 2, 2020, 3:10 p.m. OK GNU C++17 TESTS 20 234 17920000 2400
70061196 interestingLSY C Feb. 2, 2020, 3:07 p.m. OK GNU C++17 TESTS 20 295 17203200 2400
70165171 user202729_ C Feb. 3, 2020, 4:19 p.m. OK GNU C++17 TESTS 20 296 6348800 2400
70197414 user202729_ C Feb. 4, 2020, 1:38 a.m. OK GNU C++17 TESTS 20 296 7475200 2400
70208284 TonyBrown148 C Feb. 4, 2020, 7:15 a.m. OK GNU C++17 TESTS 20 296 15974400 2400
70164760 user202729_ C Feb. 3, 2020, 4:12 p.m. OK GNU C++17 TESTS 20 311 6348800 2400
70183036 Sorting C Feb. 3, 2020, 8:28 p.m. OK GNU C++17 TESTS 20 326 9420800 2400
70099869 kolina C Feb. 2, 2020, 10:26 p.m. OK GNU C++17 TESTS 20 327 9420800 2400
70210232 vjudge2 C Feb. 4, 2020, 7:57 a.m. OK GNU C++17 TESTS 20 327 10240000 2400
70165588 OrangeRain C Feb. 3, 2020, 4:24 p.m. OK GNU C++17 TESTS 20 327 10240000 2400
70092849 Suzukaze C Feb. 2, 2020, 7 p.m. OK Java 11 TESTS 20 904 73011200 2400
70067594 qwerty787788 C Feb. 2, 2020, 3:28 p.m. OK Java 11 TESTS 20 1029 70041600 2400
70057150 uwi C Feb. 2, 2020, 2:56 p.m. OK Java 8 TESTS 20 389 16793600 2400
70068838 travm12 C Feb. 2, 2020, 3:32 p.m. OK Java 8 TESTS 20 390 9011200 2400
70091142 Xylenox C Feb. 2, 2020, 6:25 p.m. OK Java 8 TESTS 20 421 4198400 2400
70407364 vovacomua C Feb. 6, 2020, 3:13 a.m. OK Java 8 TESTS 20 436 25907200 2400
70073834 cwise C Feb. 2, 2020, 3:51 p.m. OK Java 8 TESTS 20 436 56320000 2400
70090000 Taran_1407 C Feb. 2, 2020, 6:04 p.m. OK Java 8 TESTS 20 529 31027200 2400
70224588 polyakoff C Feb. 4, 2020, 11:10 a.m. OK Java 8 TESTS 20 546 31334400 2400
70806636 xodiac C Feb. 11, 2020, 6:41 p.m. OK Java 8 TESTS 20 655 69324800 2400
70186073 polyakoff C Feb. 3, 2020, 10:02 p.m. OK Java 8 TESTS 20 1201 102912000 2400
70696997 alekseev.aleksei C Feb. 9, 2020, 11:37 p.m. OK Java 8 TESTS 20 1356 40448000 2400
70067657 Tlatoani C Feb. 2, 2020, 3:28 p.m. OK Kotlin TESTS 20 420 11980800 2400
70148323 darnley C Feb. 3, 2020, 12:20 p.m. OK Kotlin TESTS 20 1809 92569600 2400
70149691 darnley C Feb. 3, 2020, 12:40 p.m. OK Kotlin TESTS 20 1933 98713600 2400
70082933 darnley C Feb. 2, 2020, 4:29 p.m. OK Kotlin TESTS 20 1949 90624000 2400
70149326 darnley C Feb. 3, 2020, 12:35 p.m. OK Kotlin TESTS 20 2121 97689600 2400
70235300 nehan_der_thal C Feb. 4, 2020, 1:28 p.m. OK Mono C# TESTS 20 2246 108441600 2400
70069490 lxhgww C Feb. 2, 2020, 3:34 p.m. OK MS C++ TESTS 20 312 9932800 2400
70073936 math957963 C Feb. 2, 2020, 3:51 p.m. OK MS C++ TESTS 20 560 41881600 2400
70205702 AleksanderBalobanov C Feb. 4, 2020, 6:18 a.m. OK MS C++ 2017 TESTS 20 373 10854400 2400
70091831 pichulia C Feb. 2, 2020, 6:39 p.m. OK MS C++ 2017 TESTS 20 374 12288000 2400
70092235 wp32pw C Feb. 2, 2020, 6:48 p.m. OK MS C++ 2017 TESTS 20 1871 62156800 2400
70086379 pajenegod C Feb. 2, 2020, 5:12 p.m. OK PyPy 2 TESTS 20 2729 109875200 2400
70150518 pineriver C Feb. 3, 2020, 12:52 p.m. OK PyPy 3 TESTS 20 2589 94924800 2400
70151150 pineriver C Feb. 3, 2020, 1 p.m. OK PyPy 3 TESTS 20 2667 95334400 2400
70083931 sansen C Feb. 2, 2020, 4:32 p.m. OK Rust TESTS 20 296 23449600 2400
70107784 sansen C Feb. 3, 2020, 4:06 a.m. OK Rust TESTS 20 389 25292800 2400

remove filters

Back to search problems