Codeforces Round 799 (Div. 4)

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
1692 Codeforces Round 799 (Div. 4) FINISHED False 8100 81962663 June 14, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7707 ) H Gambling PROGRAMMING data structures dp math

B'Marian is at a casino. The game at the casino works like this. Before each round, the player selects a number between 1 and 10^9 . After that, a dice with 10^9 faces is rolled so that a random number between 1 and 10^9 appears. If the player guesses the number correctly their total money is doubled, else their total money is halved. Marian predicted the future and knows all the numbers x_1, x_2, ... , x_n that the dice will show in the next n rounds. He will pick three integers a , l and r ( l <= q r ). He will play r-l+1 rounds (rounds between l and r inclusive). In each of these rounds, he will guess the same number a . At the start (before the round l ) he has 1 dollar. Marian asks you to determine the integers a , l and r ( 1 <= q a <= q 10^9 , 1 <= q l <= q r <= q n ) such that he makes the most money at the end. Note that during halving and multiplying there is no rounding and there are no precision errors. So, for example during a game, Marian could have money equal to dfrac{1}{1024} , dfrac{1}{128} , dfrac{1}{2} , 1 , 2 , 4 , etc. (any value of 2^t , where t is an integer of any sign). The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of rounds. The second line of each test case contains n integers x_1, x_2, ... , x_n ( 1 <= q x_i <= q 10^9 ), where x_i is the number that will fall on the dice in the i -th round. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot10^5 . For each test case, output three integers a , l , and r such that Marian makes the most amount of money gambling with his strategy. If there are multiple answers, you'...

Tutorials

Codeforces Round #799 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
160659306 extremall H June 14, 2022, 5:40 p.m. OK C# 8 TESTS 37 124 17817600
160661168 orloffm H June 14, 2022, 5:57 p.m. OK C# 8 TESTS 37 171 22732800
160665910 gxlois H June 14, 2022, 6:46 p.m. OK GNU C11 TESTS 37 124 31641600
160667244 gxlois H June 14, 2022, 7:03 p.m. OK GNU C11 TESTS 37 124 34508800
160667402 gxlois H June 14, 2022, 7:05 p.m. OK GNU C11 TESTS 37 155 26726400
160673884 gxlois H June 14, 2022, 8:50 p.m. OK GNU C11 TESTS 37 171 35328000
160673602 gxlois H June 14, 2022, 8:44 p.m. OK GNU C11 TESTS 37 171 36147200
160673737 gxlois H June 14, 2022, 8:47 p.m. OK GNU C11 TESTS 37 187 36147200
160673657 gxlois H June 14, 2022, 8:46 p.m. OK GNU C11 TESTS 37 202 28262400
160665487 gxlois H June 14, 2022, 6:41 p.m. OK GNU C11 TESTS 37 217 37785600
160673684 gxlois H June 14, 2022, 8:46 p.m. OK GNU C11 TESTS 37 249 39321600
160667216 gxlois H June 14, 2022, 7:03 p.m. OK GNU C11 TESTS 37 265 90624000
160681431 JA2012 H June 15, 2022, 1:32 a.m. OK GNU C++14 TESTS 37 61 8192000
160659293 sougataroy893 H June 14, 2022, 5:40 p.m. OK GNU C++14 TESTS 37 78 5222400
160688919 chen_zhe_ H June 15, 2022, 4:17 a.m. OK GNU C++14 TESTS 37 78 5734400
160664942 sakshamarya01 H June 14, 2022, 6:35 p.m. OK GNU C++14 TESTS 37 78 5734400
160674809 shivam_751 H June 14, 2022, 9:13 p.m. OK GNU C++14 TESTS 37 78 10035200
160689464 Sand_Tripper H June 15, 2022, 4:26 a.m. OK GNU C++14 TESTS 37 93 5427200
160692383 imak_07 H June 15, 2022, 5:11 a.m. OK GNU C++14 TESTS 38 93 5632000
160685135 quanjun H June 15, 2022, 3:05 a.m. OK GNU C++14 TESTS 37 93 8294400
160655424 _dragneel_ H June 14, 2022, 5:11 p.m. OK GNU C++14 TESTS 37 93 8396800
160669483 rohit_ H June 14, 2022, 7:33 p.m. OK GNU C++14 TESTS 37 93 8704000
160670252 10125 H June 14, 2022, 7:44 p.m. OK GNU C++17 TESTS 37 77 5734400
160690578 sanjay_mehra H June 15, 2022, 4:43 a.m. OK GNU C++17 TESTS 37 78 102400
160663502 kid-116 H June 14, 2022, 6:19 p.m. OK GNU C++17 TESTS 37 78 819200
160688094 Y_piyush9415 H June 15, 2022, 4:02 a.m. OK GNU C++17 TESTS 37 78 1638400
160665161 ErenYgR H June 14, 2022, 6:37 p.m. OK GNU C++17 TESTS 37 78 1638400
160692604 utsavm H June 15, 2022, 5:14 a.m. OK GNU C++17 TESTS 38 78 1740800
160677580 szaranczuk H June 14, 2022, 10:44 p.m. OK GNU C++17 TESTS 37 78 6246400
160671732 dg211 H June 14, 2022, 8:09 p.m. OK GNU C++17 TESTS 37 93 1740800
160684046 lniiwuw_y H June 15, 2022, 2:41 a.m. OK GNU C++17 TESTS 37 93 3174400
160680357 indianbrain H June 15, 2022, 12:55 a.m. OK GNU C++17 TESTS 37 93 4300800
160660271 OnMyZenith H June 14, 2022, 5:48 p.m. OK GNU C++17 (64) TESTS 37 61 8192000
160673347 EDITH H June 14, 2022, 8:39 p.m. OK GNU C++17 (64) TESTS 37 62 5734400
160667279 shubhamgrg1000 H June 14, 2022, 7:04 p.m. OK GNU C++17 (64) TESTS 37 77 12492800
160662601 v9ti H June 14, 2022, 6:10 p.m. OK GNU C++17 (64) TESTS 37 93 9932800
160690050 SmolBrain H June 15, 2022, 4:35 a.m. OK GNU C++17 (64) TESTS 37 93 11673600
160659953 adiagr H June 14, 2022, 5:46 p.m. OK GNU C++17 (64) TESTS 37 93 12288000
160684170 Mxrush H June 15, 2022, 2:44 a.m. OK GNU C++17 (64) TESTS 37 93 12595200
160666493 shubhamgrg1000 H June 14, 2022, 6:54 p.m. OK GNU C++17 (64) TESTS 37 93 24268800
160683361 nidaboge H June 15, 2022, 2:25 a.m. OK GNU C++17 (64) TESTS 37 93 44339200
160665137 Richw818 H June 14, 2022, 6:37 p.m. OK GNU C++17 (64) TESTS 37 108 10444800
160661045 ramakp34 H June 14, 2022, 5:56 p.m. OK GNU C++20 (64) TESTS 37 46 1638400
160659420 Ahmad.Abdelmegeed H June 14, 2022, 5:41 p.m. OK GNU C++20 (64) TESTS 37 46 4198400
160695028 huehue2322434 H June 15, 2022, 5:50 a.m. OK GNU C++20 (64) TESTS 38 46 7987200
160669659 huehue2322434 H June 14, 2022, 7:36 p.m. OK GNU C++20 (64) TESTS 37 46 7987200
160655742 Ahmed_Aladdin H June 14, 2022, 5:13 p.m. OK GNU C++20 (64) TESTS 37 61 3788800
160680077 HaccerKat H June 15, 2022, 12:44 a.m. OK GNU C++20 (64) TESTS 37 62 5734400
160686378 xls_is_real_dd H June 15, 2022, 3:30 a.m. OK GNU C++20 (64) TESTS 37 62 5734400
160690124 lite_27 H June 15, 2022, 4:36 a.m. OK GNU C++20 (64) TESTS 37 62 9113600
160678381 NokSyte H June 14, 2022, 11:21 p.m. OK GNU C++20 (64) TESTS 37 62 10547200
160694944 MistaAsh H June 15, 2022, 5:48 a.m. OK GNU C++20 (64) TESTS 38 62 11468800
160680718 0x3F H June 15, 2022, 1:09 a.m. OK Go TESTS 37 187 10240000
160678017 0x3F H June 14, 2022, 11:04 p.m. OK Go TESTS 37 187 10342400
160660278 dagnaf H June 14, 2022, 5:48 p.m. OK Go TESTS 37 217 10035200
160681355 koqo H June 15, 2022, 1:30 a.m. OK Go TESTS 37 217 12288000
160661204 rdamir86 H June 14, 2022, 5:57 p.m. OK Go TESTS 37 218 11366400
160670169 MunirKP H June 14, 2022, 7:43 p.m. OK Java 11 TESTS 37 295 5120000
160657837 NO__OB H June 14, 2022, 5:28 p.m. OK Java 11 TESTS 37 358 24268800
160673133 _ryan18_ H June 14, 2022, 8:34 p.m. OK Java 11 TESTS 37 373 23040000
160667487 tusharpruth H June 14, 2022, 7:06 p.m. OK Java 11 TESTS 37 374 25292800
160656576 the_unseen H June 14, 2022, 5:19 p.m. OK Java 11 TESTS 37 389 10240000
160691937 jiomart H June 15, 2022, 5:05 a.m. OK Java 11 TESTS 38 389 17612800
160693509 jiomart H June 15, 2022, 5:27 a.m. OK Java 11 TESTS 38 389 17612800
160667901 v0s7er H June 14, 2022, 7:12 p.m. OK Java 11 TESTS 37 389 20275200
160661809 nebula6611 H June 14, 2022, 6:03 p.m. OK Java 11 TESTS 37 389 22835200
160689199 x21svage H June 15, 2022, 4:21 a.m. OK Java 11 TESTS 37 389 23347200
160662101 Omar_Mohammad H June 14, 2022, 6:05 p.m. OK Java 8 TESTS 37 218 7065600
160654703 kishan963 H June 14, 2022, 5:07 p.m. OK Java 8 TESTS 37 249 27750400
160667962 chinmaya21 H June 14, 2022, 7:12 p.m. OK Java 8 TESTS 37 265 15257600
160681379 RetARDed1111 H June 15, 2022, 1:30 a.m. OK Java 8 TESTS 37 265 18739200
160654902 WrongAnswerOnTestCase2 H June 14, 2022, 5:08 p.m. OK Java 8 TESTS 37 296 15872000
160695472 anshulchou_123 H June 15, 2022, 5:55 a.m. OK Java 8 TESTS 38 296 16179200
160670408 sachinjaiswal H June 14, 2022, 7:47 p.m. OK Java 8 TESTS 37 327 16896000
160683787 tong96 H June 15, 2022, 2:35 a.m. OK Java 8 TESTS 37 514 16896000
160657809 liomsv H June 14, 2022, 5:28 p.m. OK Java 8 TESTS 37 951 26521600
160695041 Hakiobo H June 15, 2022, 5:50 a.m. OK Kotlin 1.4 TESTS 38 186 0
160679434 serg_alb H June 15, 2022, 12:16 a.m. OK Kotlin 1.5 TESTS 37 436 39014400
160656748 SlavaG H June 14, 2022, 5:20 p.m. OK Kotlin 1.6 TESTS 37 514 18636800
160656291 SlavaG H June 14, 2022, 5:17 p.m. OK Kotlin 1.6 TESTS 37 545 18636800
160659772 MVP_DukeX H June 14, 2022, 5:44 p.m. OK MS C++ 2017 TESTS 37 78 7270400
160677966 bsherhj H June 14, 2022, 11:02 p.m. OK MS C++ 2017 TESTS 37 202 1024000
160670098 hxu10 H June 14, 2022, 7:42 p.m. OK PyPy 3 TESTS 37 265 25292800
160690598 EpicChadGamer H June 15, 2022, 4:43 a.m. OK PyPy 3 TESTS 37 483 23142400
160674886 Ayushman_123 H June 14, 2022, 9:15 p.m. OK PyPy 3 TESTS 37 529 27238400
160691247 aayush_chhabra H June 15, 2022, 4:54 a.m. OK PyPy 3-64 TESTS 37 249 39219200
160666503 aditya3369 H June 14, 2022, 6:54 p.m. OK PyPy 3-64 TESTS 37 311 27955200
160680206 bjy H June 15, 2022, 12:49 a.m. OK PyPy 3-64 TESTS 37 311 39219200
160680215 heropro H June 15, 2022, 12:50 a.m. OK PyPy 3-64 TESTS 37 374 37990400
160681688 eidar H June 15, 2022, 1:39 a.m. OK PyPy 3-64 TESTS 37 421 39321600
160690582 sharingan000 H June 15, 2022, 4:43 a.m. OK PyPy 3-64 TESTS 37 436 33689600
160674876 Ayushman_123 H June 14, 2022, 9:14 p.m. OK PyPy 3-64 TESTS 37 436 42905600
160684506 shiviDON H June 15, 2022, 2:52 a.m. OK PyPy 3-64 TESTS 37 467 42700800
160688552 shiviDON H June 15, 2022, 4:10 a.m. OK PyPy 3-64 TESTS 37 467 43929600
160681484 z0uyu9631 H June 15, 2022, 1:33 a.m. OK PyPy 3-64 TESTS 37 592 44032000
160691054 aayush_chhabra H June 15, 2022, 4:50 a.m. OK Python 3 TESTS 37 311 19251200
160692954 wssccc H June 15, 2022, 5:19 a.m. OK Python 3 TESTS 38 373 18022400
160674896 Ayushman_123 H June 14, 2022, 9:15 p.m. OK Python 3 TESTS 37 436 19865600
160663422 kokkuri H June 14, 2022, 6:18 p.m. OK Ruby 3 TESTS 37 436 16281600
160661455 kokkuri H June 14, 2022, 5:59 p.m. OK Ruby 3 TESTS 37 514 27136000
160662399 magurofly H June 14, 2022, 6:08 p.m. OK Ruby 3 TESTS 37 561 32972800
160662512 Thallium54 H June 14, 2022, 6:09 p.m. OK Rust 2021 TESTS 37 46 11980800
160662943 Thallium54 H June 14, 2022, 6:13 p.m. OK Rust 2021 TESTS 37 46 12595200

remove filters

Back to search problems