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 |
---|---|---|---|---|---|---|
1520 | Codeforces Round 719 (Div. 3) | FINISHED | False | 7200 | 117041063 | May 5, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 3074 ) | F2 | Guess the K-th Zero (Hard version) | PROGRAMMING | binary search data structures interactive |
B"This is an interactive problem. This is a hard version of the problem. The difference from the easy version is that in the hard version 1 <= t <= min(n, 10^4) and the total number of queries is limited to 6 cdot 10^4 . Polycarp is playing a computer game. In this game, an array consisting of zeros and ones is hidden. Polycarp wins if he guesses the position of the k -th zero from the left t times. Polycarp can make no more than 6 cdot 10^4 requests totally of the following type: To make the game more interesting, each guessed zero turns into one and the game continues on the changed array. More formally, if the position of the k -th zero was x , then after Polycarp guesses this position, the x -th element of the array will be replaced from 0 to 1 . Help Polycarp win the game. First, your program must read two integers n and t ( 1 <= n <= 2 cdot 10^5 , 1 <= t <= min(n, 10^4) ). Then t lines follow, each of which contains one integer k ( 1 <= k <= n ). It is guaranteed that at the moment of the request the array contains at least k zeros. In order to get the next value of k , you must output the answer for the previous value of k . After that, you can make no more than 6 cdot 10^4 requests in total. Use the following format to output the answer (it is not a request, it doesn't count in 6 cdot 10^4 ): Positions in the array are numbered from left to right from 1 to n inclusive. After printing t answers, your program should exit immediately. In this task, the interactor is not adaptive. This means that within the same test, the hidden array and the queries do not change. In case of an incorrect query, -1 will be displayed. When this value is received, your program must immediately exit normally (for example, by calling exit(0)), otherwise, the testing system may issue an arbitrary verdict. If the number of req"... |
Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
115353204 | Jaw_7227 | F2 | May 5, 2021, 8:01 p.m. | OK | GNU C++11 | TESTS | 24 | 311 | 7065600 | ||
115344605 | noah07 | F2 | May 5, 2021, 6:20 p.m. | OK | GNU C++11 | TESTS | 24 | 342 | 6553600 | ||
115363821 | surajchip2 | F2 | May 6, 2021, 12:18 a.m. | OK | GNU C++11 | TESTS | 26 | 374 | 5529600 | ||
115355807 | ADMathNoob | F2 | May 5, 2021, 8:42 p.m. | OK | GNU C++11 | TESTS | 24 | 374 | 5529600 | ||
115366704 | pubgoso | F2 | May 6, 2021, 1:44 a.m. | OK | GNU C++11 | TESTS | 26 | 389 | 9011200 | ||
115374766 | AQT | F2 | May 6, 2021, 4:12 a.m. | OK | GNU C++11 | TESTS | 26 | 405 | 6041600 | ||
115382237 | 2014lzx | F2 | May 6, 2021, 5:44 a.m. | OK | GNU C++11 | TESTS | 26 | 452 | 6041600 | ||
115380642 | hero_zl | F2 | May 6, 2021, 5:28 a.m. | OK | GNU C++11 | TESTS | 26 | 452 | 6041600 | ||
115382665 | patelashish769 | F2 | May 6, 2021, 5:49 a.m. | OK | GNU C++11 | TESTS | 26 | 452 | 7884800 | ||
115365309 | test2222 | F2 | May 6, 2021, 1:05 a.m. | OK | GNU C++11 | TESTS | 26 | 483 | 5529600 | ||
115377014 | Kira_1234 | F2 | May 6, 2021, 4:44 a.m. | OK | GNU C++14 | TESTS | 26 | 467 | 10137600 | ||
115365259 | LightInShadow | F2 | May 6, 2021, 1:04 a.m. | OK | GNU C++14 | TESTS | 26 | 467 | 16793600 | ||
115358644 | AlanSkarica | F2 | May 5, 2021, 9:44 p.m. | OK | GNU C++14 | TESTS | 24 | 482 | 3891200 | ||
115357600 | aksayush | F2 | May 5, 2021, 9:20 p.m. | OK | GNU C++14 | TESTS | 24 | 482 | 3891200 | ||
115360624 | ro777 | F2 | May 5, 2021, 10:38 p.m. | OK | GNU C++14 | TESTS | 26 | 483 | 6963200 | ||
115360635 | ro777 | F2 | May 5, 2021, 10:39 p.m. | OK | GNU C++14 | TESTS | 26 | 499 | 6963200 | ||
115368508 | shubham_9586 | F2 | May 6, 2021, 2:26 a.m. | OK | GNU C++14 | TESTS | 26 | 514 | 5939200 | ||
115379476 | badoge | F2 | May 6, 2021, 5:15 a.m. | OK | GNU C++14 | TESTS | 26 | 514 | 6963200 | ||
115362475 | Ramu | F2 | May 5, 2021, 11:36 p.m. | OK | GNU C++14 | TESTS | 26 | 530 | 4403200 | ||
115359645 | tnaito | F2 | May 5, 2021, 10:10 p.m. | OK | GNU C++14 | TESTS | 26 | 545 | 7270400 |
Back to search problems