Codeforces Round 830 (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
1732 Codeforces Round 830 (Div. 2) FINISHED False 7200 70746863 Oct. 23, 2022, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1426 ) D2 Balance (Hard version) PROGRAMMING brute force data structures 2400

B'This is the hard version of the problem. The only difference is that in this version there are remove queries. Initially you have a set containing one element -- 0 . You need to handle q queries of the following types: In our problem, we define the k text{-mex} of a set of integers as the smallest non-negative integer x that is divisible by k and which is not contained in the set. The first line contains an integer q ( 1 <= q q <= q 2 cdot 10^5 ) -- the number of queries. The following q lines describe the queries. An addition query of integer x is given in the format + x ( 1 <= q x <= q 10^{18} ). It is guaranteed that x is not contained in the set. A remove query of integer x is given in the format - x ( 1 <= q x <= q 10^{18} ). It is guaranteed that x is contained in the set. A search query of k text{-mex} is given in the format ? k ( 1 <= q k <= q 10^{18} ). It is guaranteed that there is at least one query of type ?. For each query of type ? output a single integer -- the k text{-mex} of the set. In the first example: After the first and second queries, the set will contain elements {0, 1, 2 } . The smallest non-negative number that is divisible by 1 and is not in the set is 3 . After the fourth query, the set will contain the elements {0, 1, 2, 4 } . The smallest non-negative number that is divisible by 2 and is not in the set is 6 . In the second example: '...

Tutorials

108327

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
177675168 Tdyx D2 Oct. 23, 2022, 4:49 p.m. OK C# 8 TESTS 50 1559 98816000 2400
177634970 wsyhb D2 Oct. 23, 2022, 11:38 a.m. OK GNU C++14 TESTS 45 280 16896000 2400
177641521 qfl_zzz D2 Oct. 23, 2022, 12:02 p.m. OK GNU C++14 TESTS 45 607 6041600 2400
177637176 wlxhkk D2 Oct. 23, 2022, 11:46 a.m. OK GNU C++14 TESTS 45 702 180838400 2400
177704120 whyimalive D2 Oct. 23, 2022, 11:46 p.m. OK GNU C++14 TESTS 51 795 30822400 2400
177673985 DGJG D2 Oct. 23, 2022, 4:39 p.m. OK GNU C++14 TESTS 50 795 137830400 2400
177711124 Yuki991 D2 Oct. 24, 2022, 2:40 a.m. OK GNU C++14 TESTS 53 842 38297600 2400
177712045 shijiuwan D2 Oct. 24, 2022, 2:56 a.m. OK GNU C++14 TESTS 54 951 26726400 2400
177673208 DGJG D2 Oct. 23, 2022, 4:31 p.m. OK GNU C++14 TESTS 50 967 137830400 2400
177713494 OdtreePrincess D2 Oct. 24, 2022, 3:21 a.m. OK GNU C++14 TESTS 55 1045 31436800 2400
177706479 KbltQaQ D2 Oct. 24, 2022, 12:59 a.m. OK GNU C++14 TESTS 51 1075 32460800 2400
177721579 Bobocan D2 Oct. 24, 2022, 5:41 a.m. OK GNU C++17 TESTS 55 327 231833600 2400
177631345 RGB_ICPC7 D2 Oct. 23, 2022, 11:25 a.m. OK GNU C++17 TESTS 45 421 30822400 2400
177713167 Alinfty D2 Oct. 24, 2022, 3:16 a.m. OK GNU C++17 TESTS 55 436 8294400 2400
177636363 trainwithoutpain D2 Oct. 23, 2022, 11:43 a.m. OK GNU C++17 TESTS 45 577 36556800 2400
177633150 Jackcao D2 Oct. 23, 2022, 11:32 a.m. OK GNU C++17 TESTS 45 624 23961600 2400
177639891 MohamedAliSaidane D2 Oct. 23, 2022, 11:56 a.m. OK GNU C++17 TESTS 45 639 19968000 2400
177710156 moonwind D2 Oct. 24, 2022, 2:23 a.m. OK GNU C++17 TESTS 53 716 8294400 2400
177631491 Nutella3000 D2 Oct. 23, 2022, 11:26 a.m. OK GNU C++17 TESTS 45 748 24985600 2400
177631285 RDDCCD D2 Oct. 23, 2022, 11:25 a.m. OK GNU C++17 TESTS 45 780 31846400 2400
177718721 yaoxi D2 Oct. 24, 2022, 4:57 a.m. OK GNU C++17 TESTS 55 826 23244800 2400
177705401 lunchbox D2 Oct. 24, 2022, 12:24 a.m. OK GNU C++17 (64) TESTS 51 234 14950400 2400
177705435 lunchbox D2 Oct. 24, 2022, 12:25 a.m. OK GNU C++17 (64) TESTS 51 249 14950400 2400
177705405 lunchbox D2 Oct. 24, 2022, 12:24 a.m. OK GNU C++17 (64) TESTS 51 296 14950400 2400
177636567 Abdelrahman_Etman D2 Oct. 23, 2022, 11:44 a.m. OK GNU C++17 (64) TESTS 45 421 10547200 2400
177640870 CharlieV D2 Oct. 23, 2022, noon OK GNU C++17 (64) TESTS 45 436 9011200 2400
177648732 Andreasyan D2 Oct. 23, 2022, 1:26 p.m. OK GNU C++17 (64) TESTS 45 452 9011200 2400
177704260 q-w-q-w-q D2 Oct. 23, 2022, 11:50 p.m. OK GNU C++17 (64) TESTS 51 592 25190400 2400
177657729 edenooo D2 Oct. 23, 2022, 2:25 p.m. OK GNU C++17 (64) TESTS 45 842 142745600 2400
177704507 MoonHalo D2 Oct. 23, 2022, 11:57 p.m. OK GNU C++17 (64) TESTS 51 935 29081600 2400
177633875 emthrm D2 Oct. 23, 2022, 11:34 a.m. OK GNU C++17 (64) TESTS 45 966 31948800 2400
177717991 pracarr D2 Oct. 24, 2022, 4:45 a.m. OK GNU C++20 (64) TESTS 55 234 9932800 2400
177670463 achvanov D2 Oct. 23, 2022, 4:07 p.m. OK GNU C++20 (64) TESTS 50 280 9728000 2400
177717664 pracarr D2 Oct. 24, 2022, 4:38 a.m. OK GNU C++20 (64) TESTS 55 280 12902400 2400
177717935 pracarr D2 Oct. 24, 2022, 4:44 a.m. OK GNU C++20 (64) TESTS 55 295 12902400 2400
177717897 pracarr D2 Oct. 24, 2022, 4:43 a.m. OK GNU C++20 (64) TESTS 55 295 12902400 2400
177639536 Clonoth D2 Oct. 23, 2022, 11:55 a.m. OK GNU C++20 (64) TESTS 45 483 59187200 2400
177667756 A_G D2 Oct. 23, 2022, 3:43 p.m. OK GNU C++20 (64) TESTS 50 545 36659200 2400
177633001 IntoTheNight D2 Oct. 23, 2022, 11:31 a.m. OK GNU C++20 (64) TESTS 45 545 67686400 2400
177638997 kmjp D2 Oct. 23, 2022, 11:53 a.m. OK GNU C++20 (64) TESTS 45 623 8806400 2400
177636450 DimmyT D2 Oct. 23, 2022, 11:44 a.m. OK GNU C++20 (64) TESTS 45 733 135577600 2400
177630179 toam D2 Oct. 23, 2022, 11:22 a.m. OK PyPy 3-64 TESTS 45 1887 46796800 2400
177656094 Little_Sheep_Yawn D2 Oct. 23, 2022, 2:13 p.m. OK PyPy 3-64 TESTS 45 2292 197324800 2400

remove filters

Back to search problems