Codeforces Round 381 (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
739 Codeforces Round 381 (Div. 1) FINISHED False 7200 296486723 Nov. 23, 2016, 4:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2617 ) E Gosha is hunting PROGRAMMING brute force data structures dp flows math probabilities sortings 2900

Gosha is hunting. His goal is to catch as many Pokemons as possible. Gosha has a Poke Balls and b Ultra Balls. There are n Pokemons. They are numbered 1 through n . Gosha knows that if he throws a Poke Ball at the i -th Pokemon he catches it with probability p i . If he throws an Ultra Ball at the i -th Pokemon he catches it with probability u i . He can throw at most one Ball of each type at any Pokemon. The hunting proceeds as follows: at first, Gosha chooses no more than a Pokemons at which he will throw Poke Balls and no more than b Pokemons at which he will throw Ultra Balls. After that, he throws the chosen Balls at the chosen Pokemons. If he throws both Ultra Ball and Poke Ball at some Pokemon, he is caught if and only if he is caught by any of these Balls. The outcome of a throw doesn't depend on the other throws. Gosha would like to know what is the expected number of the Pokemons he catches if he acts in an optimal way. In other words, he would like to know the maximum possible expected number of Pokemons can catch. The first line contains three integers n , a and b ( 2 ≤ n ≤ 2000 , 0 ≤ a , b ≤ n ) — the number of Pokemons, the number of Poke Balls and the number of Ultra Balls. The second line contains n real values p 1 , p 2 , ..., p n ( 0 ≤ p i ≤ 1 ), where p i is the probability of catching the i -th Pokemon if Gosha throws a Poke Ball to it. The third line contains n real values u 1 , u 2 , ..., u n ( 0 ≤ u i ≤ 1 ), where u i is the probability of catching the i -th Pokemon if Gosha throws an Ultra Ball to it. All the probabilities are given with exactly three digits after the decimal separator. Print the maximum possible expected number of Pokemons Gosha can catch. The answer is considered correct if it's absolute or relative error doesn't exceed 10 - 4 .

Tutorials

48582

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
22730424 LiqingCao E Dec. 6, 2016, 12:49 p.m. OK GNU C TESTS 94 2449 32153600 2900
32109490 TS_Hugh E Nov. 7, 2017, 4:06 a.m. OK GNU C++ TESTS 94 30 2457600 2900
27522607 FoolPerson E June 2, 2017, 11:44 a.m. OK GNU C++ TESTS 94 31 0 2900
41625983 zhou888 E Aug. 15, 2018, 2:28 p.m. OK GNU C++ TESTS 94 31 102400 2900
39394753 elijahqi E June 19, 2018, 12:44 a.m. OK GNU C++ TESTS 94 31 102400 2900
39394737 luogu_bot4 E June 19, 2018, 12:42 a.m. OK GNU C++ TESTS 94 31 102400 2900
32109557 A_LEAF E Nov. 7, 2017, 4:16 a.m. OK GNU C++ TESTS 94 31 1638400 2900
39202691 SovietPower E June 12, 2018, 11:22 p.m. OK GNU C++ TESTS 94 46 0 2900
39088233 SovietPower E June 10, 2018, 9:30 a.m. OK GNU C++ TESTS 94 46 0 2900
42363903 1592063346 E Sept. 2, 2018, 1:26 p.m. OK GNU C++ TESTS 94 46 102400 2900
41259019 yybyyb E Aug. 6, 2018, 12:50 a.m. OK GNU C++ TESTS 94 46 102400 2900
22686543 krijgertje E Dec. 3, 2016, 11:44 p.m. OK GNU C++11 TESTS 94 15 921600 2900
36226732 vjudge2 E March 12, 2018, 2:17 p.m. OK GNU C++11 TESTS 94 30 2252800 2900
28181489 G.O.D.1 E July 1, 2017, midnight OK GNU C++11 TESTS 94 30 2969600 2900
65325675 SuperFF E Nov. 19, 2019, 12:52 a.m. OK GNU C++11 TESTS 94 31 0 2900
47870929 Stump E Jan. 3, 2019, 12:49 p.m. OK GNU C++11 TESTS 94 31 0 2900
44827959 XSamsara E Oct. 25, 2018, 7:08 a.m. OK GNU C++11 TESTS 94 31 0 2900
54743765 fancunxin1 E May 28, 2019, 9:27 a.m. OK GNU C++11 TESTS 94 31 102400 2900
47095731 jambow E Dec. 16, 2018, 8:20 a.m. OK GNU C++11 TESTS 94 31 102400 2900
46388857 luogu_bot1 E Nov. 30, 2018, 3:25 a.m. OK GNU C++11 TESTS 94 31 102400 2900
41678658 zjp_shadow E Aug. 17, 2018, 9:29 a.m. OK GNU C++11 TESTS 94 31 102400 2900
23688463 lukatiger E Jan. 10, 2017, 10:25 p.m. OK GNU C++14 TESTS 94 30 1945600 2900
40983094 ReaLNero1 E July 30, 2018, 6:43 p.m. OK GNU C++14 TESTS 94 31 0 2900
22618410 NiroBC E Nov. 30, 2016, 9:36 a.m. OK GNU C++14 TESTS 94 31 307200 2900
32111460 _LowestJN E Nov. 7, 2017, 6:57 a.m. OK GNU C++14 TESTS 94 31 1638400 2900
32111317 LowestJN E Nov. 7, 2017, 6:49 a.m. OK GNU C++14 TESTS 94 31 1638400 2900
36058455 _quq E March 8, 2018, 12:03 a.m. OK GNU C++14 TESTS 94 31 1945600 2900
23688508 lukatiger E Jan. 10, 2017, 10:34 p.m. OK GNU C++14 TESTS 94 31 1945600 2900
23688495 lukatiger E Jan. 10, 2017, 10:32 p.m. OK GNU C++14 TESTS 94 31 1945600 2900
23688428 lukatiger E Jan. 10, 2017, 10:19 p.m. OK GNU C++14 TESTS 94 31 1945600 2900
23671761 vilim_l E Jan. 9, 2017, 10:24 p.m. OK GNU C++14 TESTS 94 31 1945600 2900
62440411 acka1357 E Oct. 12, 2019, 7:09 p.m. OK GNU C++17 TESTS 94 31 0 2900
62439608 acka1357 E Oct. 12, 2019, 6:49 p.m. OK GNU C++17 TESTS 94 31 0 2900
62438527 acka1357 E Oct. 12, 2019, 6:24 p.m. OK GNU C++17 TESTS 94 31 0 2900
62438132 acka1357 E Oct. 12, 2019, 6:15 p.m. OK GNU C++17 TESTS 94 31 0 2900
62434805 acka1357 E Oct. 12, 2019, 4:59 p.m. OK GNU C++17 TESTS 94 31 0 2900
47865779 vjudge4 E Jan. 3, 2019, 9:35 a.m. OK GNU C++17 TESTS 94 31 102400 2900
68686799 saketh E Jan. 13, 2020, 3:58 a.m. OK GNU C++17 TESTS 94 31 204800 2900
68682807 saketh E Jan. 13, 2020, 12:41 a.m. OK GNU C++17 TESTS 94 46 0 2900
62438475 spectaclehong E Oct. 12, 2019, 6:23 p.m. OK GNU C++17 TESTS 94 46 0 2900
67772624 hqwertyh E Dec. 28, 2019, 7:30 a.m. OK GNU C++17 TESTS 94 46 102400 2900
32784036 ThiagoMM E Nov. 29, 2017, 3:04 p.m. OK GNU C++17 Diagnostics TESTS 94 1902 102297600 2900
68627348 Suzukaze E Jan. 11, 2020, 11:23 p.m. OK Java 11 TESTS 94 296 0 2900
22447523 Egor E Nov. 23, 2016, 6:22 p.m. OK Java 8 TESTS 94 171 0 2900
31190360 meijun E Oct. 10, 2017, 1:03 p.m. OK Java 8 TESTS 94 233 0 2900
36726440 alexrcoleman E March 29, 2018, 4:24 p.m. OK Java 8 TESTS 94 295 21708800 2900
36726178 alexrcoleman E March 29, 2018, 4:13 p.m. OK Java 8 TESTS 94 296 21708800 2900
58469925 fetetriste E Aug. 8, 2019, 10:45 p.m. OK Java 8 TESTS 94 421 42393600 2900
36726795 alexrcoleman E March 29, 2018, 4:39 p.m. OK Java 8 TESTS 94 561 21811200 2900
54483904 Jeel_Vaishnav E May 22, 2019, 12:13 p.m. OK Java 8 TESTS 94 686 0 2900
29640481 akshay_miterani E Aug. 21, 2017, 9:51 a.m. OK Java 8 TESTS 94 1045 0 2900
40925854 U_Square E July 29, 2018, 6:19 p.m. OK Java 8 TESTS 94 1060 0 2900
31189061 meijun E Oct. 10, 2017, 12:15 p.m. OK Java 8 TESTS 94 3073 78028800 2900
29326047 guoshiyuan484 E Aug. 10, 2017, 12:14 p.m. OK MS C++ TESTS 94 31 2252800 2900
29325711 guoshiyuan484 E Aug. 10, 2017, noon OK MS C++ TESTS 94 31 2252800 2900
43085688 guoshiyuan484 E Sept. 19, 2018, 3:58 p.m. OK MS C++ TESTS 94 46 102400 2900
64449273 vjudge1 E Nov. 7, 2019, 6:25 a.m. OK MS C++ TESTS 94 46 614400 2900
44757155 vjudge3 E Oct. 24, 2018, 3:48 a.m. OK MS C++ TESTS 94 46 3481600 2900
64449046 vjudge3 E Nov. 7, 2019, 6:21 a.m. OK MS C++ TESTS 94 62 614400 2900
51478413 vjudge1 E March 19, 2019, 10:18 a.m. OK MS C++ TESTS 94 405 1331200 2900
47789915 guoshiyuan484 E Dec. 31, 2018, 12:48 p.m. OK MS C++ TESTS 94 857 75161600 2900
47383910 vjudge4 E Dec. 23, 2018, 1:54 a.m. OK MS C++ TESTS 94 858 49561600 2900
47383905 vjudge4 E Dec. 23, 2018, 1:54 a.m. OK MS C++ TESTS 94 873 49561600 2900
64182516 EbTech E Nov. 4, 2019, 2:12 a.m. OK Rust TESTS 94 46 102400 2900
64182326 EbTech E Nov. 4, 2019, 2:03 a.m. OK Rust TESTS 94 46 102400 2900

remove filters

Back to search problems