Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics)

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
1500 Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics) FINISHED False 9000 121553663 March 13, 2021, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 284 ) E Subset Trick PROGRAMMING binary search data structures 3300

B"Vanya invented an interesting trick with a set of integers. Let an illusionist have a set of positive integers S . He names a positive integer x . Then an audience volunteer must choose some subset (possibly, empty) of S without disclosing it to the illusionist. The volunteer tells the illusionist the size of the chosen subset. And here comes the trick: the illusionist guesses whether the sum of the subset elements does not exceed x . The sum of elements of an empty subset is considered to be 0 . Vanya wants to prepare the trick for a public performance. He prepared some set of distinct positive integers S . Vasya wants the trick to be successful. He calls a positive number x unsuitable, if he can't be sure that the trick would be successful for every subset a viewer can choose. Vanya wants to count the number of unsuitable integers for the chosen set S . Vanya plans to try different sets S . He wants you to write a program that finds the number of unsuitable integers for the initial set S , and after each change to the set S . Vanya will make q changes to the set, and each change is one of the following two types: The first line contains two integers n , q ( 1 <= q n, q <= q 200 ,000 ) -- the size of the initial set S and the number of changes. The next line contains n distinct integers s_1, s_2, ldots, s_n ( 1 <= q s_i <= q 10^{13} ) -- the initial elements of S . Each of the following q lines contain two integers t_i , a_i ( 1 <= q t_i <= q 2 , 1 <= q a_i <= q 10^{13} ), describing a change: Print q + 1 lines. In the first line print the number of unsuitable integers for the initial set S . In the next q lines print the number of unsuitable integers for S after each change. In the first example the initial set is S = {1, 2, 3 } . For this set the trick can be unsuccessful for x in {1,"...

Tutorials

Codeforces Round #707 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109933257 TiwAirOAO E March 14, 2021, 3:36 a.m. OK GNU C++14 TESTS 87 1965 87142400 3300
109894668 Radewoosh E March 13, 2021, 1:25 p.m. OK GNU C++14 TESTS 87 2339 113152000 3300
109883572 Miracle03 E March 13, 2021, 11:24 a.m. OK GNU C++17 TESTS 87 2262 60416000 3300
109922548 rainboy E March 13, 2021, 8 p.m. OK GNU C++17 TESTS 87 2371 19251200 3300
109932089 Isoeasy E March 14, 2021, 3:01 a.m. OK GNU C++17 TESTS 87 2698 304640000 3300
109912699 Egor.Lifar E March 13, 2021, 4:59 p.m. OK GNU C++17 TESTS 87 2994 104960000 3300
109880186 jiangly E March 13, 2021, 11:11 a.m. OK GNU C++17 (64) TESTS 87 1357 45670400 3300
109869658 tourist E March 13, 2021, 10:29 a.m. OK GNU C++17 (64) TESTS 87 1684 50790400 3300
109869772 ecnerwala E March 13, 2021, 10:29 a.m. OK GNU C++17 (64) TESTS 87 1980 19251200 3300
109882627 maroonrk E March 13, 2021, 11:21 a.m. OK GNU C++17 (64) TESTS 87 2168 37273600 3300
109920188 rainboy E March 13, 2021, 7:07 p.m. OK GNU C++17 (64) TESTS 87 2183 19148800 3300
109920347 rainboy E March 13, 2021, 7:10 p.m. OK GNU C++17 (64) TESTS 87 2199 19148800 3300
109930770 wlzhouzhuan E March 14, 2021, 2:11 a.m. OK GNU C++17 (64) TESTS 87 2324 44953600 3300
109916666 Ormlis E March 13, 2021, 6:01 p.m. OK GNU C++17 (64) TESTS 87 2448 84992000 3300
109913021 Egor.Lifar E March 13, 2021, 5:04 p.m. OK GNU C++17 (64) TESTS 87 2464 105881600 3300
109914751 Mangooste E March 13, 2021, 5:30 p.m. OK GNU C++17 (64) TESTS 87 2947 37683200 3300

remove filters

Back to search problems