Educational Codeforces Round 141 (Rated for 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
1783 Educational Codeforces Round 141 (Rated for Div. 2) FINISHED False 7200 63991463 Jan. 8, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2165 ) E Game of the Year PROGRAMMING brute force math number theory

B"Monocarp and Polycarp are playing a computer game. This game features n bosses for the playing to kill, numbered from 1 to n . They will fight each boss the following way: Monocarp kills the i -th boss on his a_i -th attempt. Polycarp kills the i -th boss on his b_i -th attempt. After one of them kills the i -th boss, they move on to the (i+1) -st boss. The attempt counters reset for both of them. Once one of them kills the n -th boss, the game ends. Find all values of k from 1 to n such that Monocarp kills all bosses. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains a single integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of bosses. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) -- the index of attempt Monocarp kills each boss on. The third line contains n integers b_1, b_2, ... , b_n ( 1 <= b_i <= n ) -- the index of attempt Polycarp kills each boss on. The sum of n over all testcases doesn't exceed 2 cdot 10^5 . For each testcase, print two lines. The first line should contain a single integer mathit{cnt} -- the number of values of k from 1 to n such that Monocarp kills all bosses. The second line should contain mathit{cnt} distinct integers -- the values of k themselves. Consider the last testcase of the example. Let k = 1 . First, Monocarp makes one attempt to kill the first boss. It's successful, since a_1 = 1 . Then, Monocarp makes one attempt to kill the second boss. It's unsuccessful, since a_2 > 1 . So, Polycarp makes an attempt then. It's also unsuccessful, since b_2 > 1 . Then, Monocarp makes another attempt. It's still unsuccessful, since a_2 > 2 . This goes on until Polycarp finally kills the boss on his third attemp"...

Tutorials

Educational Codeforces Round 141 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
188522170 Moka50 E Jan. 8, 2023, 8:06 p.m. OK GNU C11 TESTS 31 857 3993600
188501791 chro4896 E Jan. 8, 2023, 4:41 p.m. OK GNU C11 TESTS 31 1559 5632000
188540695 icyM3tra E Jan. 9, 2023, 4:27 a.m. OK GNU C++14 TESTS 31 109 3686400
188502893 CoachDanke E Jan. 8, 2023, 4:47 p.m. OK GNU C++14 TESTS 31 124 3174400
188539312 Flamire E Jan. 9, 2023, 4:04 a.m. OK GNU C++14 TESTS 31 124 3174400
188533304 Maezra6 E Jan. 9, 2023, 1:50 a.m. OK GNU C++14 TESTS 31 124 3276800
188526261 KiFaH_HeLaL E Jan. 8, 2023, 9:35 p.m. OK GNU C++14 TESTS 31 124 3993600
188505140 Luminolic_Black E Jan. 8, 2023, 5:01 p.m. OK GNU C++14 TESTS 31 124 3993600
188531238 DaiRuiChen007 E Jan. 9, 2023, 12:41 a.m. OK GNU C++14 TESTS 31 124 3993600
188538179 daniel14311531 E Jan. 9, 2023, 3:42 a.m. OK GNU C++14 TESTS 31 124 3993600
188510820 batyousef E Jan. 8, 2023, 5:48 p.m. OK GNU C++14 TESTS 31 124 6451200
188496437 NoPotato E Jan. 8, 2023, 4:28 p.m. OK GNU C++14 TESTS 31 140 3174400
188526179 mister E Jan. 8, 2023, 9:33 p.m. OK GNU C++17 TESTS 31 109 3993600
188519477 SpatzaCamino E Jan. 8, 2023, 7:24 p.m. OK GNU C++17 TESTS 31 124 3174400
188514112 Eurick E Jan. 8, 2023, 6:18 p.m. OK GNU C++17 TESTS 31 124 3174400
188528210 mohamed_sameh12 E Jan. 8, 2023, 10:39 p.m. OK GNU C++17 TESTS 31 124 3174400
188539897 Abdulloh55 E Jan. 9, 2023, 4:13 a.m. OK GNU C++17 TESTS 31 124 3174400
188537647 Blaz E Jan. 9, 2023, 3:30 a.m. OK GNU C++17 TESTS 31 124 3276800
188526878 SLin25 E Jan. 8, 2023, 9:53 p.m. OK GNU C++17 TESTS 31 124 3993600
188519931 Sara.S. E Jan. 8, 2023, 7:32 p.m. OK GNU C++17 TESTS 31 124 3993600
188530291 brown_toad E Jan. 9, 2023, 12:01 a.m. OK GNU C++17 TESTS 31 124 3993600
188539422 binglengmo E Jan. 9, 2023, 4:06 a.m. OK GNU C++17 TESTS 31 124 3993600
188503840 Semp E Jan. 8, 2023, 4:53 p.m. OK GNU C++17 (64) TESTS 31 31 6656000
188503373 Semp E Jan. 8, 2023, 4:50 p.m. OK GNU C++17 (64) TESTS 31 46 71782400
188504473 tom0727 E Jan. 8, 2023, 4:57 p.m. OK GNU C++17 (64) TESTS 31 78 8192000
188525637 PurpleCrayon E Jan. 8, 2023, 9:18 p.m. OK GNU C++17 (64) TESTS 31 92 4505600
188519887 lunchbox E Jan. 8, 2023, 7:31 p.m. OK GNU C++17 (64) TESTS 31 93 1843200
188524891 efficient E Jan. 8, 2023, 9 p.m. OK GNU C++17 (64) TESTS 31 93 4505600
188539026 xhchen E Jan. 9, 2023, 3:58 a.m. OK GNU C++17 (64) TESTS 31 93 4505600
188528115 lis05 E Jan. 8, 2023, 10:36 p.m. OK GNU C++17 (64) TESTS 31 93 4505600
188523413 Origenes E Jan. 8, 2023, 8:30 p.m. OK GNU C++17 (64) TESTS 31 93 4505600
188509875 moo. E Jan. 8, 2023, 5:40 p.m. OK GNU C++17 (64) TESTS 31 93 4505600
188507219 Mehedi99 E Jan. 8, 2023, 5:17 p.m. OK GNU C++20 (64) TESTS 31 62 3276800
188530954 20Ti_ntson E Jan. 9, 2023, 12:30 a.m. OK GNU C++20 (64) TESTS 31 62 4505600
188516071 AS01 E Jan. 8, 2023, 6:39 p.m. OK GNU C++20 (64) TESTS 31 62 4505600
188544549 HuParry E Jan. 9, 2023, 5:30 a.m. OK GNU C++20 (64) TESTS 31 62 4505600
188539686 Leonard E Jan. 9, 2023, 4:10 a.m. OK GNU C++20 (64) TESTS 31 62 4505600
188543974 Kidding__Ma E Jan. 9, 2023, 5:21 a.m. OK GNU C++20 (64) TESTS 31 62 4505600
188542430 yiyiCat2 E Jan. 9, 2023, 4:57 a.m. OK GNU C++20 (64) TESTS 31 62 4608000
188544251 _AnyaForger_ E Jan. 9, 2023, 5:25 a.m. OK GNU C++20 (64) TESTS 31 62 4608000
188525456 FzArK E Jan. 8, 2023, 9:14 p.m. OK GNU C++20 (64) TESTS 31 62 4608000
188503775 T4M0FEY E Jan. 8, 2023, 4:52 p.m. OK GNU C++20 (64) TESTS 31 62 4608000
188506351 shubhargava E Jan. 8, 2023, 5:10 p.m. OK Java 11 TESTS 31 389 8704000
188505650 Dukkha E Jan. 8, 2023, 5:05 p.m. OK Java 17 TESTS 31 1777 1536000
188507003 golions E Jan. 8, 2023, 5:15 p.m. OK Java 8 TESTS 31 248 5836800
188524814 danilgrig E Jan. 8, 2023, 8:59 p.m. OK MS C++ 2017 TESTS 31 499 8396800
188525970 danilgrig E Jan. 8, 2023, 9:27 p.m. OK MS C++ 2017 TESTS 31 499 15462400
188525324 danilgrig E Jan. 8, 2023, 9:11 p.m. OK MS C++ 2017 TESTS 31 576 28262400
188524136 hxu10 E Jan. 8, 2023, 8:44 p.m. OK PyPy 3 TESTS 31 327 26214400
188543233 anishde85 E Jan. 9, 2023, 5:10 a.m. OK PyPy 3 TESTS 31 405 39014400
188525706 AadiS E Jan. 8, 2023, 9:20 p.m. OK PyPy 3 TESTS 31 608 23040000
188508841 toam E Jan. 8, 2023, 5:31 p.m. OK PyPy 3-64 TESTS 31 233 33689600
188530518 yupooh E Jan. 9, 2023, 12:10 a.m. OK PyPy 3-64 TESTS 31 265 36352000
188505666 jgs03177 E Jan. 8, 2023, 5:05 p.m. OK PyPy 3-64 TESTS 31 1528 124006400
188535135 variance E Jan. 9, 2023, 2:35 a.m. OK Rust 2021 TESTS 31 233 28262400

remove filters

Back to search problems