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 |
---|---|---|---|---|---|---|
1852 | Codeforces Round 887 (Div. 1) | FINISHED | False | 9000 | 41700299 | July 23, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4537 ) | B | Imbalanced Arrays | PROGRAMMING | constructive algorithms greedy sortings two pointers |
B'Ntarsis has come up with an array a of n non-negative integers. Call an array b of n integers imbalanced if it satisfies the following: Given the array a , Ntarsis wants you to construct some imbalanced array. Help him solve this task, or determine it is impossible. 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 has a single integer n ( 1 <= q n <= q 10^5 ). The next line contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q n ). It is guaranteed that the sum of n across all test cases does not exceed 10^5 . For each test case, output "NO" if there exists no imbalanced array. Otherwise, output "YES". Then, on the next line, output n integers b_1, b_2, ldots, b_n where b_i neq 0 for all 1 <= q i <= q n -- an imbalanced array. For the first test case, b = [1] is an imbalanced array. This is because for i = 1 , there is exactly one j ( j = 1 ) where b_1 + b_j > 0 . For the second test case, it can be shown that there exists no imbalanced array. For the third test case, a = [0, 1, 0] . The array b = [-3, 1, -2] is an imbalanced array. '... |
Codeforces Round 887 (Div 1, Div 2) Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
215230725 | KumaTachiRen | B | July 23, 2023, 3:50 p.m. | OK | C# 8 | TESTS | 49 | 109 | 6860800 | ||
215214034 | hos.lyric | B | July 23, 2023, 3:08 p.m. | OK | D | TESTS | 49 | 234 | 13516800 | ||
215217842 | Gassa | B | July 23, 2023, 3:16 p.m. | OK | D | TESTS | 49 | 249 | 6144000 | ||
215284440 | ITworker_Z | B | July 24, 2023, 1:05 a.m. | OK | GNU C++14 | TESTS | 49 | 31 | 4505600 | ||
215287250 | harinboy | B | July 24, 2023, 1:49 a.m. | OK | GNU C++14 | TESTS | 49 | 46 | 1331200 | ||
215218522 | jiangtaizhe001 | B | July 23, 2023, 3:18 p.m. | OK | GNU C++14 | TESTS | 49 | 46 | 3276800 | ||
215213824 | wangyian2022 | B | July 23, 2023, 3:08 p.m. | OK | GNU C++14 | TESTS | 49 | 46 | 3276800 | ||
215240052 | Leasier | B | July 23, 2023, 4:22 p.m. | OK | GNU C++14 | TESTS | 49 | 46 | 3686400 | ||
215227972 | Junz_LJL | B | July 23, 2023, 3:42 p.m. | OK | GNU C++14 | TESTS | 49 | 46 | 4812800 | ||
215225065 | whdywjd | B | July 23, 2023, 3:34 p.m. | OK | GNU C++14 | TESTS | 49 | 46 | 9420800 | ||
215225105 | wrhaco | B | July 23, 2023, 3:35 p.m. | OK | GNU C++14 | TESTS | 49 | 46 | 35123200 | ||
215228053 | jrsy | B | July 23, 2023, 3:43 p.m. | OK | GNU C++14 | TESTS | 49 | 61 | 2355200 | ||
215235931 | mwzqwq | B | July 23, 2023, 4:07 p.m. | OK | GNU C++14 | TESTS | 49 | 62 | 1228800 | ||
215224517 | pippeladins | B | July 23, 2023, 3:33 p.m. | OK | GNU C++17 | TESTS | 49 | 46 | 1228800 | ||
215220143 | -is-this-fft- | B | July 23, 2023, 3:22 p.m. | OK | GNU C++17 | TESTS | 49 | 46 | 1228800 | ||
215235948 | Sedmoklasnikut | B | July 23, 2023, 4:07 p.m. | OK | GNU C++17 | TESTS | 49 | 46 | 1638400 | ||
215215605 | 74TrAkToR | B | July 23, 2023, 3:11 p.m. | OK | GNU C++17 | TESTS | 49 | 46 | 2048000 | ||
215293399 | el3ctricstick | B | July 24, 2023, 3:10 a.m. | OK | GNU C++17 | TESTS | 49 | 61 | 1228800 | ||
215224129 | ooaa | B | July 23, 2023, 3:32 p.m. | OK | GNU C++17 | TESTS | 49 | 61 | 1228800 | ||
215221995 | lxhgww | B | July 23, 2023, 3:26 p.m. | OK | GNU C++17 | TESTS | 49 | 61 | 1228800 | ||
215217712 | sava-cska | B | July 23, 2023, 3:16 p.m. | OK | GNU C++17 | TESTS | 49 | 61 | 1228800 | ||
215213632 | alex.kudryashov | B | July 23, 2023, 3:07 p.m. | OK | GNU C++17 | TESTS | 49 | 61 | 1228800 | ||
215209638 | pineapple_tree_34 | B | July 23, 2023, 2:59 p.m. | OK | GNU C++17 | TESTS | 49 | 61 | 1228800 | ||
215206062 | QAQAutoMaton | B | July 23, 2023, 2:53 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 31 | 5836800 | ||
215271806 | Leoknowstheway | B | July 23, 2023, 8:45 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215260667 | sammyMaX | B | July 23, 2023, 6:32 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215258126 | uwu | B | July 23, 2023, 6:10 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215228293 | Kude | B | July 23, 2023, 3:43 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215221635 | HCPS42 | B | July 23, 2023, 3:25 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215208517 | _su1sen | B | July 23, 2023, 2:57 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215202505 | Geothermal | B | July 23, 2023, 2:47 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1228800 | ||
215214906 | PurpleCrayon | B | July 23, 2023, 3:10 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1638400 | ||
215213902 | BigBag | B | July 23, 2023, 3:08 p.m. | OK | GNU C++17 (64) | TESTS | 49 | 46 | 1638400 | ||
215296193 | FoolestBoy | B | July 24, 2023, 3:43 a.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215286603 | Felix555 | B | July 24, 2023, 1:39 a.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215242036 | AQil | B | July 23, 2023, 4:29 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215229245 | BlueBottle | B | July 23, 2023, 3:46 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215228313 | 36champ | B | July 23, 2023, 3:43 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215228005 | status_coding | B | July 23, 2023, 3:42 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215223282 | Ricki_White | B | July 23, 2023, 3:30 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215221381 | applepi216 | B | July 23, 2023, 3:25 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215217429 | maxplus | B | July 23, 2023, 3:15 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215210167 | okwedook | B | July 23, 2023, 3 p.m. | OK | GNU C++20 (64) | TESTS | 49 | 31 | 1228800 | ||
215232917 | golions | B | July 23, 2023, 3:57 p.m. | OK | Java 8 | TESTS | 49 | 171 | 0 | ||
215235892 | cc4414 | B | July 23, 2023, 4:07 p.m. | OK | Java 8 | TESTS | 49 | 233 | 0 | ||
215212603 | Tlatoani | B | July 23, 2023, 3:05 p.m. | OK | Kotlin 1.6 | TESTS | 49 | 389 | 6041600 | ||
215211516 | Hakiobo | B | July 23, 2023, 3:03 p.m. | OK | Kotlin 1.7 | TESTS | 49 | 623 | 82227200 | ||
215205098 | PavelKunyavskiy | B | July 23, 2023, 2:51 p.m. | OK | Kotlin 1.7 | TESTS | 49 | 1294 | 66457600 | ||
215276289 | eogito | B | July 23, 2023, 10:01 p.m. | OK | MS C++ 2017 | TESTS | 49 | 218 | 1228800 | ||
215247538 | Age8 | B | July 23, 2023, 4:51 p.m. | OK | PyPy 3 | TESTS | 49 | 498 | 11571200 | ||
215224891 | hxu10 | B | July 23, 2023, 3:34 p.m. | OK | PyPy 3 | TESTS | 49 | 530 | 13312000 | ||
215229918 | SPD_9X2 | B | July 23, 2023, 3:48 p.m. | OK | PyPy 3 | TESTS | 49 | 608 | 26112000 | ||
215203600 | conqueror_of_tourist | B | July 23, 2023, 2:49 p.m. | OK | PyPy 3-64 | TESTS | 49 | 249 | 17817600 | ||
215213020 | sgybgm | B | July 23, 2023, 3:06 p.m. | OK | PyPy 3-64 | TESTS | 49 | 311 | 19865600 | ||
215221088 | delena0702 | B | July 23, 2023, 3:24 p.m. | OK | PyPy 3-64 | TESTS | 49 | 327 | 19456000 | ||
215214908 | plevande | B | July 23, 2023, 3:10 p.m. | OK | PyPy 3-64 | TESTS | 49 | 343 | 15360000 | ||
215248186 | tassei903 | B | July 23, 2023, 4:54 p.m. | OK | PyPy 3-64 | TESTS | 49 | 389 | 15155200 | ||
215241310 | flygon | B | July 23, 2023, 4:26 p.m. | OK | PyPy 3-64 | TESTS | 49 | 405 | 23142400 | ||
215227379 | Maruzensky | B | July 23, 2023, 3:41 p.m. | OK | PyPy 3-64 | TESTS | 49 | 421 | 19968000 | ||
215222138 | alexwice | B | July 23, 2023, 3:27 p.m. | OK | PyPy 3-64 | TESTS | 49 | 421 | 26316800 | ||
215217835 | Kita | B | July 23, 2023, 3:16 p.m. | OK | PyPy 3-64 | TESTS | 49 | 498 | 18227200 | ||
215222808 | chinerist | B | July 23, 2023, 3:28 p.m. | OK | PyPy 3-64 | TESTS | 49 | 514 | 21708800 | ||
215225704 | Jimanbanashi | B | July 23, 2023, 3:36 p.m. | OK | Python 2 | TESTS | 49 | 545 | 14848000 | ||
215237928 | nairb | B | July 23, 2023, 4:14 p.m. | OK | Rust 2021 | TESTS | 49 | 1700 | 7372800 |
Back to search problems