Codeforces Round 941 (Div. 1)

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
1965 Codeforces Round 941 (Div. 1) FINISHED False 7200 17594699 April 27, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 431 ) D Missing Subarray Sum PROGRAMMING constructive algorithms 2900

B'There is a hidden array a of n positive integers. You know that a is a palindrome, or in other words, for all 1 <= i <= n , a_i = a_{n + 1 - i} . You are given the sums of all but one of its distinct subarrays, in arbitrary order. The subarray whose sum is not given can be any of the frac{n(n+1)}{2} distinct subarrays of a . Recover any possible palindrome a . The input is chosen such that there is always at least one array a that satisfies the conditions. An array b is a subarray of a if b can be obtained from a by the deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. The first line of the input contains a single integer t ( 1 <= t <= 200 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 3 <= n <= 1000 ) -- the size of the array a . The next line of each test case contains frac{n(n+1)}{2} - 1 integers s_i ( 1 <= q s_i <= q 10^9 ) -- all but one of the subarray sums of a . It is guaranteed that the sum of n over all test cases does not exceed 1000 . Additional constraint on the input: There is always at least one valid solution. Hacks are disabled for this problem. For each test case, print one line containing n positive integers a_1, a_2, cdots a_n -- any valid array a . Note that a must be a palindrome. If there are multiple solutions, print any. For the first example case, the subarrays of a = [1, 2, 1] are: For the second example case, the missing subarray sum is 4 , for the subarray [2, 2] . For the third example case, the missing subarray sum is 13 , because there are two subarrays with sum 13 ( [3, 5, 5] and [5, 5, 3] ) but 13 only occurs once in the input. '...

Tutorials

Codeforces Round #941 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
258463112 1437vszombies D April 27, 2024, 4:22 p.m. OK C++14 (GCC 6-32) TESTS 70 218 4096000 2900
262647729 luogu_bot5 D May 26, 2024, 4:35 a.m. OK C++14 (GCC 6-32) TESTS 70 218 8089600 2900
258805621 KellyWLJ D April 30, 2024, 2:55 a.m. OK C++14 (GCC 6-32) TESTS 70 234 7987200 2900
259965890 little_vegetable D May 8, 2024, 7:47 a.m. OK C++14 (GCC 6-32) TESTS 70 296 7168000 2900
258542440 liuyz11 D April 28, 2024, 9:30 a.m. OK C++14 (GCC 6-32) TESTS 70 311 43110400 2900
258502328 D_F_S D April 28, 2024, 1:18 a.m. OK C++14 (GCC 6-32) TESTS 70 312 16281600 2900
260211270 Sanj1234 D May 10, 2024, 6:22 a.m. OK C++14 (GCC 6-32) TESTS 70 359 20070400 2900
261522822 Lsince_yx D May 18, 2024, 11:33 a.m. OK C++14 (GCC 6-32) TESTS 70 374 16896000 2900
258803198 10000point D April 30, 2024, 2:05 a.m. OK C++14 (GCC 6-32) TESTS 70 374 20070400 2900
258502742 _l_l_ D April 28, 2024, 1:30 a.m. OK C++14 (GCC 6-32) TESTS 70 452 17408000 2900
258768128 Ilya_MSU D April 29, 2024, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 70 202 1536000 2900
258477437 Everule D April 27, 2024, 6:22 p.m. OK C++17 (GCC 7-32) TESTS 70 234 1843200 2900
262647623 Ricky2021 D May 26, 2024, 4:33 a.m. OK C++17 (GCC 7-32) TESTS 70 234 8089600 2900
258715809 pring D April 29, 2024, 2:50 p.m. OK C++17 (GCC 7-32) TESTS 70 249 4096000 2900
258705841 pring D April 29, 2024, 2:39 p.m. OK C++17 (GCC 7-32) TESTS 70 249 4096000 2900
258862166 Xellos D April 30, 2024, 2:12 p.m. OK C++17 (GCC 7-32) TESTS 70 265 4710400 2900
260765527 YeahPotato D May 13, 2024, 8:29 a.m. OK C++17 (GCC 7-32) TESTS 70 296 4403200 2900
259965829 little_vegetable D May 8, 2024, 7:47 a.m. OK C++17 (GCC 7-32) TESTS 70 312 7168000 2900
258467255 yokozuna57 D April 27, 2024, 4:32 p.m. OK C++17 (GCC 7-32) TESTS 70 343 5632000 2900
258485469 efe0 D April 27, 2024, 7:44 p.m. OK C++17 (GCC 7-32) TESTS 70 358 21401600 2900
258619235 enslaved D April 28, 2024, 9:23 p.m. OK C++20 (GCC 13-64) TESTS 70 171 409600 2900
258455999 Nyaan D April 27, 2024, 4:01 p.m. OK C++20 (GCC 13-64) TESTS 70 186 409600 2900
258498664 shino16 D April 27, 2024, 11:23 p.m. OK C++20 (GCC 13-64) TESTS 70 187 145203200 2900
258483429 A_G D April 27, 2024, 7:20 p.m. OK C++20 (GCC 13-64) TESTS 70 202 2662400 2900
258477730 S2speed D April 27, 2024, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 70 202 10752000 2900
259700855 HaitangSuki D May 6, 2024, 3:38 a.m. OK C++20 (GCC 13-64) TESTS 70 202 33689600 2900
258479624 S2speed D April 27, 2024, 6:41 p.m. OK C++20 (GCC 13-64) TESTS 70 203 10752000 2900
258687154 WQhuanm. D April 29, 2024, 12:46 p.m. OK C++20 (GCC 13-64) TESTS 70 217 35840000 2900
258482617 Golovanov399 D April 27, 2024, 7:11 p.m. OK C++20 (GCC 13-64) TESTS 70 218 3891200 2900
258994769 learner_RR D May 1, 2024, 10:22 a.m. OK C++20 (GCC 13-64) TESTS 70 218 5632000 2900
258481572 rainboy D April 27, 2024, 7 p.m. OK GNU C11 TESTS 70 171 6246400 2900
258466768 bruhopen D April 27, 2024, 4:30 p.m. OK Kotlin 1.9 TESTS 70 811 15564800 2900
258465243 Tlatoani D April 27, 2024, 4:27 p.m. OK Kotlin 1.9 TESTS 70 1296 54681600 2900
262165599 arnavsingh_047 D May 22, 2024, 3:54 p.m. OK PyPy 3 TESTS 70 734 42393600 2900
258560428 Repsaj21o D April 28, 2024, 12:18 p.m. OK PyPy 3-64 TESTS 70 389 70758400 2900
258595826 el_tunel D April 28, 2024, 4:55 p.m. OK PyPy 3-64 TESTS 70 405 64102400 2900
258516443 Ibrohim0704 D April 28, 2024, 5:07 a.m. OK PyPy 3-64 TESTS 70 468 73932800 2900
258466272 dyppp D April 27, 2024, 4:30 p.m. OK PyPy 3-64 TESTS 70 858 81817600 2900
258465801 bronze_coder D April 27, 2024, 4:29 p.m. OK PyPy 3-64 TESTS 70 967 66355200 2900
261584534 lzw75 D May 18, 2024, 10:54 p.m. OK PyPy 3-64 TESTS 70 1046 60620800 2900
260000942 timiss D May 8, 2024, 12:50 p.m. OK Python 3 TESTS 70 593 61030400 2900
260761497 2200033007_KLU D May 13, 2024, 7:45 a.m. OK Python 3 TESTS 70 656 60620800 2900
259097200 lalitha_72 D May 2, 2024, 7:57 a.m. OK Python 3 TESTS 70 717 60620800 2900
258998965 qyzy D May 1, 2024, 11:10 a.m. OK Python 3 TESTS 70 718 60928000 2900

remove filters

Back to search problems