Codeforces Round 492 (Div. 1) [Thanks, uDebug!]

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
995 Codeforces Round 492 (Div. 1) [Thanks, uDebug!] FINISHED False 7200 201965099 June 24, 2018, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 767 ) D Game PROGRAMMING math 2400

B"Allen and Bessie are playing a simple number game. They both know a function f: {0, 1 }^n to mathbb{R} , i. e. the function takes n binary arguments and returns a real value. At the start of the game, the variables x_1, x_2, ... , x_n are all set to -1 . Each round, with equal probability, one of Allen or Bessie gets to make a move. A move consists of picking an i such that x_i = -1 and either setting x_i to 0 or x_i to 1 . After n rounds all variables are set, and the game value resolves to f(x_1, x_2, ... , x_n) . Allen wants to maximize the game value, and Bessie wants to minimize it. Your goal is to help Allen and Bessie find the expected game value! They will play r+1 times though, so between each game, exactly one value of f changes. In other words, between rounds i and i+1 for 1 <= i <= r , f(z_1, ... , z_n) to g_i for some (z_1, ... , z_n) in {0, 1 }^n . You are to find the expected game value in the beginning and after each change. The first line contains two integers n and r ( 1 <= n <= 18 , 0 <= r <= 2^{18} ). The next line contains 2^n integers c_0, c_1, ... , c_{2^n-1} ( 0 <= c_i <= 10^9 ), denoting the initial values of f . More specifically, f(x_0, x_1, ... , x_{n-1}) = c_x , if x = overline{x_{n-1} ldots x_0} in binary. Each of the next r lines contains two integers z and g ( 0 <= z <= 2^n - 1 , 0 <= g <= 10^9 ). If z = overline{z_{n-1} ... z_0} in binary, then this means to set f(z_0, ... , z_{n-1}) to g . Print r+1 lines, the i -th of which denotes the value of the game f during the i -th round. Your answer must have absolute or relative error within 10^{-6} . Formally, let your answer be a , and the jury's answer be b . Your answer is considered correct if frac{|a - b|}{ max{(1, |"...

Tutorials

Editorial for Codeforces Round #492 [Thanks u-Debug!]

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
69504185 hos.lyric D Jan. 25, 2020, 7:50 a.m. OK D TESTS 53 514 36454400 2400
39655917 ruban D June 25, 2018, 5:07 p.m. OK Delphi TESTS 53 342 78540800 2400
39983612 Siyuan D July 5, 2018, 12:10 p.m. OK GNU C++ TESTS 53 312 1843200 2400
39795367 Scut82 D June 30, 2018, 11:03 a.m. OK GNU C++ TESTS 53 327 1024000 2400
40015190 jzqjzq D July 6, 2018, 1:20 a.m. OK GNU C++ TESTS 53 327 8089600 2400
42224316 vjudge2 D Aug. 29, 2018, 12:46 a.m. OK GNU C++ TESTS 53 342 4812800 2400
39625675 yasugongshang D June 24, 2018, 6:12 p.m. OK GNU C++ TESTS 53 343 2150400 2400
39795006 Scut82 D June 30, 2018, 10:47 a.m. OK GNU C++ TESTS 53 343 8089600 2400
39663377 Ghastlcon D June 26, 2018, 2:30 a.m. OK GNU C++ TESTS 53 405 3993600 2400
39624587 MissMyDearest D June 24, 2018, 6:03 p.m. OK GNU C++ TESTS 53 436 1024000 2400
39886611 guille D July 3, 2018, 7:37 a.m. OK GNU C++ TESTS 53 436 1126400 2400
39615888 DEGwer D June 24, 2018, 5:03 p.m. OK GNU C++ TESTS 53 451 7884800 2400
44858895 test616.cpp D Oct. 25, 2018, 3:16 p.m. OK GNU C++11 TESTS 53 124 1024000 2400
39666526 neal D June 26, 2018, 5:48 a.m. OK GNU C++11 TESTS 53 202 1126400 2400
39666540 neal D June 26, 2018, 5:49 a.m. OK GNU C++11 TESTS 53 217 1228800 2400
39688190 neal D June 27, 2018, 12:59 a.m. OK GNU C++11 TESTS 53 218 921600 2400
39666577 neal D June 26, 2018, 5:51 a.m. OK GNU C++11 TESTS 53 218 1024000 2400
39666558 neal D June 26, 2018, 5:50 a.m. OK GNU C++11 TESTS 53 218 1126400 2400
39666500 neal D June 26, 2018, 5:47 a.m. OK GNU C++11 TESTS 53 218 1126400 2400
39666571 neal D June 26, 2018, 5:50 a.m. OK GNU C++11 TESTS 53 218 1536000 2400
39689263 neal D June 27, 2018, 2:33 a.m. OK GNU C++11 TESTS 53 233 921600 2400
39688679 neal D June 27, 2018, 1:47 a.m. OK GNU C++11 TESTS 53 280 921600 2400
46353320 neal D Nov. 29, 2018, 6:43 a.m. OK GNU C++14 TESTS 53 109 2150400 2400
46353111 neal D Nov. 29, 2018, 6:35 a.m. OK GNU C++14 TESTS 53 109 2150400 2400
46353360 neal D Nov. 29, 2018, 6:44 a.m. OK GNU C++14 TESTS 53 124 2150400 2400
46353259 neal D Nov. 29, 2018, 6:41 a.m. OK GNU C++14 TESTS 53 140 2150400 2400
46353300 neal D Nov. 29, 2018, 6:42 a.m. OK GNU C++14 TESTS 53 155 2150400 2400
40931738 ReaLNero1 D July 30, 2018, 1:16 a.m. OK GNU C++14 TESTS 53 186 4198400 2400
40931512 ReaLNero1 D July 30, 2018, 1:04 a.m. OK GNU C++14 TESTS 53 451 7987200 2400
58165419 gs15120 D Aug. 2, 2019, 8:52 a.m. OK GNU C++14 TESTS 53 452 6963200 2400
55848384 Scut82 D June 21, 2019, 12:53 a.m. OK GNU C++14 TESTS 53 467 1024000 2400
39626057 natsugiri D June 24, 2018, 6:15 p.m. OK GNU C++14 TESTS 53 467 3174400 2400
39622032 LiChenKoh D June 24, 2018, 5:43 p.m. OK GNU C++17 TESTS 53 374 1024000 2400
39636366 q234rty D June 25, 2018, 2:46 a.m. OK GNU C++17 TESTS 53 374 11059200 2400
53809943 vjudge1 D May 6, 2019, 5:47 a.m. OK GNU C++17 TESTS 53 452 1024000 2400
39636186 zoomswk D June 25, 2018, 2:33 a.m. OK GNU C++17 TESTS 53 468 1024000 2400
44281369 ko_osaga D Oct. 14, 2018, 4:56 a.m. OK GNU C++17 TESTS 53 483 1433600 2400
54070713 betrue12 D May 13, 2019, 4:04 p.m. OK GNU C++17 TESTS 53 514 1024000 2400
52897673 Jester D April 17, 2019, 9:44 a.m. OK GNU C++17 TESTS 53 514 1024000 2400
39639400 kongroo D June 25, 2018, 5:50 a.m. OK GNU C++17 TESTS 53 514 1024000 2400
65286204 A_Fan_of_the_AK_King--lk D Nov. 18, 2019, 8:10 a.m. OK GNU C++17 TESTS 53 514 2048000 2400
40057248 Sanja D July 7, 2018, 9:44 a.m. OK GNU C++17 TESTS 53 530 4198400 2400
39625463 uwi D June 24, 2018, 6:10 p.m. OK Java 8 TESTS 53 374 0 2400
39622647 Lewin D June 24, 2018, 5:48 p.m. OK Java 8 TESTS 53 654 0 2400
39637118 lucasr D June 25, 2018, 3:35 a.m. OK Java 8 TESTS 53 795 11878400 2400
39644420 amnesiac_dusk D June 25, 2018, 9:15 a.m. OK Java 8 TESTS 53 795 36352000 2400
39642293 fnch D June 25, 2018, 7:50 a.m. OK Java 8 TESTS 53 795 38195200 2400
39627310 Petr D June 24, 2018, 6:24 p.m. OK Java 8 TESTS 53 811 13312000 2400
39630744 kessido D June 24, 2018, 8:19 p.m. OK Java 8 TESTS 53 826 11878400 2400
64494679 beginner1010 D Nov. 7, 2019, 10:29 p.m. OK Java 8 TESTS 53 857 0 2400
39627290 AkshajK D June 24, 2018, 6:24 p.m. OK Java 8 TESTS 53 857 14950400 2400
39625507 qwerty787788 D June 24, 2018, 6:11 p.m. OK Java 8 TESTS 53 1278 12288000 2400
39624158 RAVEman D June 24, 2018, 6 p.m. OK MS C++ TESTS 53 483 4198400 2400
39626676 wa1tz719 D June 24, 2018, 6:20 p.m. OK MS C++ TESTS 53 514 1024000 2400
39674297 mdeacu D June 26, 2018, 11:41 a.m. OK MS C++ TESTS 53 2028 8499200 2400
39651349 anon01 D June 25, 2018, 1:50 p.m. OK Perl TESTS 53 1653 66662400 2400
39630592 pikmike D June 24, 2018, 8:16 p.m. OK PyPy 3 TESTS 53 1825 32563200 2400
39634286 MathisHammel D June 24, 2018, 11:45 p.m. OK Python 2 TESTS 53 1372 14438400 2400
39631024 Ali_Pi D June 24, 2018, 8:26 p.m. OK Python 2 TESTS 53 1621 16793600 2400
39730546 orailly D June 28, 2018, 1:54 a.m. OK Python 3 TESTS 53 1154 32051200 2400
39630344 Ali_Pi D June 24, 2018, 8:11 p.m. OK Python 3 TESTS 53 1700 31641600 2400
39623059 CrazyMerlyn D June 24, 2018, 5:51 p.m. OK Python 3 TESTS 53 1746 31641600 2400
63343352 fruha D Oct. 24, 2019, 6:21 p.m. OK Python 3 TESTS 53 1855 22220800 2400

remove filters

Back to search problems