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 |
---|---|---|---|---|---|---|
1981 | Codeforces Round 949 (Div. 2) | FINISHED | False | 7200 | 20030063 | May 31, 2024, 10:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5520 ) | C | Turtle and an Incomplete Sequence | PROGRAMMING | bitmasks constructive algorithms greedy implementation math |
B"Turtle was playing with a sequence a_1, a_2, ldots, a_n consisting of positive integers. Unfortunately, some of the integers went missing while playing. Now the sequence becomes incomplete. There may exist an arbitrary number of indices i such that a_i becomes -1 . Let the new sequence be a' . Turtle is sad. But Turtle remembers that for every integer i from 1 to n - 1 , either a_i = <= ft lfloor frac{a_{i + 1}}{2} right rfloor or a_{i + 1} = <= ft lfloor frac{a_i}{2} right rfloor holds for the original sequence a . Turtle wants you to help him complete the sequence. But sometimes Turtle makes mistakes, so you need to tell him if you can't complete the sequence. Formally, you need to find another sequence b_1, b_2, ldots, b_n consisting of positive integers such that: If there is no sequence b_1, b_2, ldots, b_n that satisfies all of the conditions above, you need to report -1 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^5 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the length of the sequence. The second line of each test case contains n integers a'_1, a'_2, ldots, a'_n ( a'_i = -1 or 1 <= a'_i <= 10^8 ) -- the elements of the sequence a' . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, if there is no sequence b_1, b_2, ldots, b_n that satisfies all of the conditions, output a single integer -1 . Otherwise, output n integers b_1, b_2, ldots, b_n -- the elements of the sequence b_1, b_2, ldots, b_n you find. The sequence should satisfy that 1 <= b_i <= 10^9 for every integer i from 1 to n . If there are multiple answers, print any of them. In "... |
Simplified Chinese Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
263622974 | 4927618350 | C | June 1, 2024, 11:40 a.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 108 | 819200 | ||
263508622 | a999999 | C | May 31, 2024, 2 p.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 125 | 8294400 | ||
263685418 | 0mBudsman | C | June 1, 2024, 10:59 p.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 0 | ||
263669019 | ajay_0555 | C | June 1, 2024, 6:18 p.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 0 | ||
263554612 | LG805653 | C | May 31, 2024, 10:34 p.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 819200 | ||
263554591 | LG805653 | C | May 31, 2024, 10:33 p.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 819200 | ||
263611466 | Rating_10101010 | C | June 1, 2024, 10:12 a.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 1638400 | ||
263577119 | Ender32k | C | June 1, 2024, 5:17 a.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 1638400 | ||
263497983 | yuhang_ | C | May 31, 2024, 12:35 p.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 2457600 | ||
263557941 | yuanzhenxuan | C | June 1, 2024, 12:08 a.m. | OK | C++14 (GCC 6-32) | TESTS | 16 | 140 | 3174400 | ||
263618737 | AAli963 | C | June 1, 2024, 11:10 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 61 | 921600 | ||
263620483 | AAli963 | C | June 1, 2024, 11:22 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 62 | 921600 | ||
263621038 | AAli963 | C | June 1, 2024, 11:25 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 77 | 921600 | ||
263645144 | Jakub_Woxniak | C | June 1, 2024, 2:51 p.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 108 | 819200 | ||
263565019 | luoyehhh | C | June 1, 2024, 2:39 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 108 | 1638400 | ||
263661022 | tester70 | C | June 1, 2024, 5:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 109 | 0 | ||
263558847 | Elrashedy | C | June 1, 2024, 12:32 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 109 | 0 | ||
263615259 | AAli963 | C | June 1, 2024, 10:45 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 109 | 819200 | ||
263584762 | AAli963 | C | June 1, 2024, 6:31 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 109 | 819200 | ||
263565718 | rdcamelot | C | June 1, 2024, 2:51 a.m. | OK | C++17 (GCC 7-32) | TESTS | 16 | 109 | 819200 | ||
263507736 | Hoks_ | C | May 31, 2024, 1:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 62 | 21196800 | ||
263694186 | Golem__ | C | June 2, 2024, 3:09 a.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 77 | 1024000 | ||
263636945 | kalaz | C | June 1, 2024, 1:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 78 | 102400 | ||
263615832 | ShahdAbdelaziz | C | June 1, 2024, 10:49 a.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263594643 | anshul_darediya | C | June 1, 2024, 7:53 a.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263581315 | computerscience | C | June 1, 2024, 6 a.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263565846 | BhavdeepSinghNijhawan | C | June 1, 2024, 2:53 a.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263548278 | ishwarendra | C | May 31, 2024, 8:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263525545 | uy__uy | C | May 31, 2024, 4:22 p.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263512114 | RakibulIslam | C | May 31, 2024, 2:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 16 | 93 | 0 | ||
263523673 | ruban | C | May 31, 2024, 4:06 p.m. | OK | Delphi | TESTS | 16 | 327 | 39219200 | ||
263520520 | ArminArlert69 | C | May 31, 2024, 3:39 p.m. | OK | GNU C11 | TESTS | 16 | 1109 | 1638400 | ||
263519426 | Szzzp | C | May 31, 2024, 3:29 p.m. | OK | GNU C11 | TESTS | 16 | 1124 | 1638400 | ||
263559322 | Willump1 | C | June 1, 2024, 12:44 a.m. | OK | GNU C11 | TESTS | 16 | 1171 | 921600 | ||
263664941 | Vivaan_231010259 | C | June 1, 2024, 5:40 p.m. | OK | GNU C11 | TESTS | 16 | 1171 | 1638400 | ||
263497435 | 79209748 | C | May 31, 2024, 12:31 p.m. | OK | Go | TESTS | 16 | 108 | 12697600 | ||
263660019 | nguyenquocthao00 | C | June 1, 2024, 4:56 p.m. | OK | Go | TESTS | 16 | 249 | 15462400 | ||
263526379 | polsage | C | May 31, 2024, 4:29 p.m. | OK | Java 21 | TESTS | 16 | 390 | 6860800 | ||
263571866 | amit_roy | C | June 1, 2024, 4:11 a.m. | OK | Java 21 | TESTS | 16 | 390 | 21196800 | ||
263568684 | priyaroy3370 | C | June 1, 2024, 3:34 a.m. | OK | Java 21 | TESTS | 16 | 390 | 21196800 | ||
263669854 | himneesh9 | C | June 1, 2024, 6:25 p.m. | OK | Java 21 | TESTS | 16 | 406 | 7577600 | ||
263581694 | gaju_01 | C | June 1, 2024, 6:03 a.m. | OK | Java 21 | TESTS | 16 | 577 | 1024000 | ||
263589646 | gaju_01 | C | June 1, 2024, 7:11 a.m. | OK | Java 21 | TESTS | 16 | 577 | 1843200 | ||
263500710 | GaleStarr | C | May 31, 2024, 12:53 p.m. | OK | Java 21 | TESTS | 16 | 671 | 1638400 | ||
263601357 | jai_hanumant | C | June 1, 2024, 8:48 a.m. | OK | Java 21 | TESTS | 16 | 890 | 1331200 | ||
263560718 | dzhi | C | June 1, 2024, 1:19 a.m. | OK | Java 21 | TESTS | 16 | 1296 | 5120000 | ||
263529007 | xorfftdp | C | May 31, 2024, 4:52 p.m. | OK | Java 21 | TESTS | 16 | 1640 | 18329600 | ||
263499874 | safarisoul | C | May 31, 2024, 12:47 p.m. | OK | Java 8 | TESTS | 16 | 343 | 5529600 | ||
263497795 | jingxi | C | May 31, 2024, 12:33 p.m. | OK | Java 8 | TESTS | 16 | 343 | 5529600 | ||
263608115 | nomadicjuggrnaut | C | June 1, 2024, 9:44 a.m. | OK | Java 8 | TESTS | 16 | 624 | 6348800 | ||
263504103 | kasiru_69 | C | May 31, 2024, 1:21 p.m. | OK | Java 8 | TESTS | 16 | 687 | 6348800 | ||
263503503 | admiok123 | C | May 31, 2024, 1:16 p.m. | OK | Java 8 | TESTS | 16 | 687 | 6348800 | ||
263578149 | om172 | C | June 1, 2024, 5:28 a.m. | OK | Java 8 | TESTS | 16 | 843 | 0 | ||
263639155 | rahulkmishra2806 | C | June 1, 2024, 2 p.m. | OK | Java 8 | TESTS | 16 | 905 | 0 | ||
263594280 | rjrajeevofficial | C | June 1, 2024, 7:50 a.m. | OK | Java 8 | TESTS | 16 | 906 | 0 | ||
263603128 | dauletomarov1130 | C | June 1, 2024, 9:02 a.m. | OK | Java 8 | TESTS | 16 | 921 | 0 | ||
263647155 | PlayDate | C | June 1, 2024, 3:09 p.m. | OK | Java 8 | TESTS | 16 | 1077 | 0 | ||
263501430 | pchel | C | May 31, 2024, 12:58 p.m. | OK | Kotlin 1.9 | TESTS | 16 | 593 | 19968000 | ||
263506960 | jvatsal0709 | C | May 31, 2024, 1:46 p.m. | OK | PyPy 3 | TESTS | 16 | 609 | 20070400 | ||
263614125 | FliccEatsPizza | C | June 1, 2024, 10:35 a.m. | OK | PyPy 3 | TESTS | 16 | 1483 | 21811200 | ||
263549928 | Nullz | C | May 31, 2024, 8:50 p.m. | OK | PyPy 3-64 | TESTS | 16 | 265 | 29081600 | ||
263655282 | sathvik_67 | C | June 1, 2024, 4:18 p.m. | OK | PyPy 3-64 | TESTS | 16 | 296 | 29184000 | ||
263603726 | Shri_874 | C | June 1, 2024, 9:07 a.m. | OK | PyPy 3-64 | TESTS | 16 | 343 | 26931200 | ||
263573431 | cybsbbb | C | June 1, 2024, 4:31 a.m. | OK | PyPy 3-64 | TESTS | 16 | 374 | 31129600 | ||
263618966 | sohampalkar | C | June 1, 2024, 11:11 a.m. | OK | PyPy 3-64 | TESTS | 16 | 374 | 37785600 | ||
263554648 | Pras28 | C | May 31, 2024, 10:34 p.m. | OK | PyPy 3-64 | TESTS | 16 | 374 | 40243200 | ||
263502609 | _Kee | C | May 31, 2024, 1:08 p.m. | OK | PyPy 3-64 | TESTS | 16 | 405 | 26726400 | ||
263554398 | MistaFlash | C | May 31, 2024, 10:27 p.m. | OK | PyPy 3-64 | TESTS | 16 | 405 | 31744000 | ||
263550559 | DrRhaegal | C | May 31, 2024, 9:01 p.m. | OK | PyPy 3-64 | TESTS | 16 | 405 | 39833600 | ||
263498635 | toam | C | May 31, 2024, 12:38 p.m. | OK | PyPy 3-64 | TESTS | 16 | 406 | 28672000 | ||
263524427 | pranjal_99 | C | May 31, 2024, 4:12 p.m. | OK | Python 3 | TESTS | 16 | 937 | 26009600 | ||
263514917 | Heartbeateffect | C | May 31, 2024, 2:50 p.m. | OK | Python 3 | TESTS | 16 | 1108 | 28160000 | ||
263533713 | toor | C | May 31, 2024, 5:34 p.m. | OK | Rust 2021 | TESTS | 16 | 109 | 512000 | ||
263599452 | vstiff | C | June 1, 2024, 8:32 a.m. | OK | Rust 2021 | TESTS | 16 | 187 | 12083200 | ||
263614045 | Cheshulko | C | June 1, 2024, 10:35 a.m. | OK | Rust 2021 | TESTS | 16 | 296 | 14028800 |
Back to search problems