Codeforces Round 593 (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
1236 Codeforces Round 593 (Div. 2) FINISHED False 7200 166119887 Oct. 17, 2019, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 678 ) E Alice and the Unfair Game PROGRAMMING binary search data structures dp ds 2600

B'Alice is playing a game with her good friend, Marisa. There are n boxes arranged in a line, numbered with integers from 1 to n from left to right. Marisa will hide a doll in one of the boxes. Then Alice will have m chances to guess where the doll is. If Alice will correctly guess the number of box, where doll is now, she will win the game, otherwise, her friend will win the game. In order to win, Marisa will use some unfair tricks. After each time Alice guesses a box, she can move the doll to the neighboring box or just keep it at its place. Boxes i and i + 1 are neighboring for all 1 <= q i <= q n - 1 . She can also use this trick once before the game starts. So, the game happens in this order: the game starts, Marisa makes the trick, Alice makes the first guess, Marisa makes the trick, Alice makes the second guess, Marisa makes the trick, ldots , Alice makes m -th guess, Marisa makes the trick, the game ends. Alice has come up with a sequence a_1, a_2, ldots, a_m . In the i -th guess, she will ask if the doll is in the box a_i . She wants to know the number of scenarios (x, y) (for all 1 <= q x, y <= q n ), such that Marisa can win the game if she will put the doll at the x -th box at the beginning and at the end of the game, the doll will be at the y -th box. Help her and calculate this number. The first line contains two integers n and m , separated by space ( 1 <= q n, m <= q 10^5 ) -- the number of boxes and the number of guesses, which Alice will make. The next line contains m integers a_1, a_2, ldots, a_m , separated by spaces ( 1 <= q a_i <= q n ), the number a_i means the number of the box which Alice will guess in the i -th guess. Print the number of scenarios in a single line, or the number of pairs of boxes (x, y) ( 1 <= q x, y <= q n ), such that if Marisa will put the doll into the box with number '...

Tutorials

70654

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
62887600 rainboy E Oct. 18, 2019, 7 p.m. OK GNU C11 TESTS 132 46 2457600 2600
62808684 Pelmelnik2 E Oct. 17, 2019, 2:58 p.m. OK GNU C11 TESTS 132 46 3993600 2600
62931056 Dream-chasing_Juvenile E Oct. 19, 2019, 12:43 p.m. OK GNU C++11 TESTS 132 31 1638400 2600
62874854 caeious E Oct. 18, 2019, 2:58 p.m. OK GNU C++11 TESTS 132 31 2252800 2600
64581612 qrsikno1 E Nov. 9, 2019, 12:16 p.m. OK GNU C++11 TESTS 132 31 3584000 2600
62854444 goodmorning200 E Oct. 18, 2019, 8:43 a.m. OK GNU C++11 TESTS 132 31 3993600 2600
62856516 lzoilxy E Oct. 18, 2019, 9:25 a.m. OK GNU C++11 TESTS 132 31 11878400 2600
62897445 xyx0711 E Oct. 19, 2019, 1:39 a.m. OK GNU C++11 TESTS 132 46 1433600 2600
63221190 ZredXNy E Oct. 23, 2019, 7:55 a.m. OK GNU C++11 TESTS 132 46 1638400 2600
62806526 tripPple_A E Oct. 17, 2019, 2:47 p.m. OK GNU C++11 TESTS 132 46 2457600 2600
66136532 vjudge4 E Dec. 1, 2019, 12:28 p.m. OK GNU C++11 TESTS 132 46 2764800 2600
66136514 SCLchuck E Dec. 1, 2019, 12:27 p.m. OK GNU C++11 TESTS 132 46 2764800 2600
62814186 Yousef_Salama E Oct. 17, 2019, 3:28 p.m. OK GNU C++14 TESTS 132 46 1228800 2600
62823176 kmjp E Oct. 17, 2019, 5:14 p.m. OK GNU C++14 TESTS 132 46 1638400 2600
62841621 yan-zp E Oct. 18, 2019, 3:09 a.m. OK GNU C++14 TESTS 132 46 2048000 2600
65594489 NDKhoa E Nov. 23, 2019, 3:20 p.m. OK GNU C++14 TESTS 132 46 2048000 2600
62899079 tbzard E Oct. 19, 2019, 2:59 a.m. OK GNU C++14 TESTS 132 46 2048000 2600
62842756 little_waxberry E Oct. 18, 2019, 3:50 a.m. OK GNU C++14 TESTS 132 46 2457600 2600
62837232 TwentyOneHundredOrBust E Oct. 17, 2019, 11:36 p.m. OK GNU C++14 TESTS 132 46 2560000 2600
68923975 ALEPH E Jan. 16, 2020, 9:58 a.m. OK GNU C++14 TESTS 132 46 2764800 2600
63773065 Owen_codeisking E Oct. 30, 2019, 8:39 a.m. OK GNU C++14 TESTS 132 46 2867200 2600
66572274 zudikn E Dec. 10, 2019, 5:27 a.m. OK GNU C++14 TESTS 132 46 2867200 2600
62893666 DrSwad E Oct. 18, 2019, 10:01 p.m. OK GNU C++17 TESTS 132 46 1228800 2600
62863194 LowR E Oct. 18, 2019, 11:26 a.m. OK GNU C++17 TESTS 132 46 1228800 2600
62809159 betrue12 E Oct. 17, 2019, 3:01 p.m. OK GNU C++17 TESTS 132 46 1228800 2600
62867426 polyomino E Oct. 18, 2019, 12:41 p.m. OK GNU C++17 TESTS 132 46 1638400 2600
62838882 Fulisike E Oct. 18, 2019, 1:05 a.m. OK GNU C++17 TESTS 132 46 2048000 2600
62836763 ZieiN E Oct. 17, 2019, 11:11 p.m. OK GNU C++17 TESTS 132 46 2048000 2600
62833653 emthrm E Oct. 17, 2019, 9 p.m. OK GNU C++17 TESTS 132 46 2048000 2600
62916495 Rafaaaaaaaaaaaam E Oct. 19, 2019, 8:48 a.m. OK GNU C++17 TESTS 132 46 2048000 2600
64351069 typhigh E Nov. 6, 2019, 8:23 a.m. OK GNU C++17 TESTS 132 46 2048000 2600
64599296 krijgertje E Nov. 9, 2019, 6:01 p.m. OK GNU C++17 TESTS 132 46 2457600 2600
62834101 uwi E Oct. 17, 2019, 9:14 p.m. OK Java 8 TESTS 132 124 0 2600
62805316 SergeyMelnikov E Oct. 17, 2019, 2:41 p.m. OK Java 8 TESTS 132 155 0 2600
63395445 JoelWee E Oct. 25, 2019, 4:31 p.m. OK Java 8 TESTS 132 218 307200 2600
62839042 dalt E Oct. 18, 2019, 1:13 a.m. OK Java 8 TESTS 132 218 14028800 2600
62887599 Dukkha E Oct. 18, 2019, 7 p.m. OK Java 8 TESTS 132 249 0 2600
62962365 golions E Oct. 20, 2019, 1:53 a.m. OK Java 8 TESTS 132 249 9728000 2600
64779691 Ahmad E Nov. 13, 2019, 6:34 a.m. OK Java 8 TESTS 132 265 40345600 2600
64750773 Nutella3000 E Nov. 12, 2019, 3:09 p.m. OK Java 8 TESTS 132 405 80998400 2600
62814787 AnandOza E Oct. 17, 2019, 3:31 p.m. OK Java 8 TESTS 132 608 91955200 2600
62821059 Musin E Oct. 17, 2019, 4:49 p.m. OK Java 8 TESTS 132 950 11161600 2600
62896664 Tlatoani E Oct. 19, 2019, 12:47 a.m. OK Kotlin TESTS 132 264 0 2600
63027842 claw88 E Oct. 20, 2019, 5:03 p.m. OK Mono C# TESTS 132 93 8294400 2600
62832638 pajenegod E Oct. 17, 2019, 8:31 p.m. OK PyPy 2 TESTS 132 171 9011200 2600
62892935 titia E Oct. 18, 2019, 9:32 p.m. OK PyPy 3 TESTS 132 326 16281600 2600
66973893 sruthi_1729 E Dec. 15, 2019, 2:02 p.m. OK Python 3 TESTS 132 685 16076800 2600

remove filters

Back to search problems