Codeforces Global Round 22

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
1738 Codeforces Global Round 22 FINISHED False 9000 67274699 Sept. 30, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15817 ) B Prefix Sum Addicts PROGRAMMING constructive algorithms math sortings

B'Suppose a_1, a_2, ... , a_n is a sorted integer sequence of length n such that a_1 <= q a_2 <= q ... <= q a_n . For every 1 <= q i <= q n , the prefix sum s_i of the first i terms a_1, a_2, ... , a_i is defined by s_i = sum_{k=1}^i a_k = a_1 + a_2 + ... + a_i. Now you are given the last k terms of the prefix sums, which are s_{n-k+1}, ... , s_{n-1}, s_{n} . Your task is to determine whether this is possible. Formally, given k integers s_{n-k+1}, ... , s_{n-1}, s_{n} , the task is to check whether there is a sequence a_1, a_2, ... , a_n such that Each test contains multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The following lines contain the description of each test case. The first line of each test case contains two integers n ( 1 <= q n <= q 10^5 ) and k ( 1 <= q k <= q n ), indicating the length of the sequence a and the number of terms of prefix sums, respectively. The second line of each test case contains k integers s_{n-k+1}, ... , s_{n-1}, s_{n} ( -10^9 <= q s_i <= q 10^9 for every n-k+1 <= q i <= q n ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output "YES" (without quotes) if it is possible and "NO" (without quotes) otherwise. You can output "YES" and "NO" in any case (for example, strings "yEs", "yes" and "Yes" will be recognized as a positive response). In the first test case, we have the only sequence a = [1, 1, 1, 1, 1] . In the second test case, we can choose, for example, a = [-3, -2, -1, 0, 1, 2, 3] . In the third test case, the prefix sums define the only sequence a = [2, 1, 1] , but it is not sorted. In the fourth test case, it can be shown that there is no sequence with the given prefix sums. '...

Tutorials

Editorial of Codeforces Global Round <strong>22</strong>

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
174200021 cfdqwqdfc B Oct. 1, 2022, 4:51 a.m. OK Clang++17 Diagnostics TESTS 92 1496 2048000
174197534 tony4875 B Oct. 1, 2022, 4:18 a.m. OK Clang++20 Diagnostics TESTS 92 1715 9523200
174150542 1435730 B Sept. 30, 2022, 4:52 p.m. OK GNU C11 TESTS 92 77 409600
174167057 Interested B Sept. 30, 2022, 6:51 p.m. OK GNU C11 TESTS 92 452 1536000
174200926 Imdie B Oct. 1, 2022, 5:03 a.m. OK GNU C++14 TESTS 92 46 819200
174162923 Who_Am_l B Sept. 30, 2022, 6:21 p.m. OK GNU C++14 TESTS 92 61 1433600
174197941 COVINA B Oct. 1, 2022, 4:24 a.m. OK GNU C++14 TESTS 92 61 1638400
174167998 vijay_746 B Sept. 30, 2022, 7 p.m. OK GNU C++14 TESTS 92 61 2355200
174189864 hubei_L B Oct. 1, 2022, 2:12 a.m. OK GNU C++14 TESTS 92 61 2457600
174198896 spybit B Oct. 1, 2022, 4:36 a.m. OK GNU C++14 TESTS 92 61 2457600
174188136 Ghostxxx B Oct. 1, 2022, 1:40 a.m. OK GNU C++14 TESTS 92 61 110182400
174194520 ScottSuperb B Oct. 1, 2022, 3:31 a.m. OK GNU C++14 TESTS 92 62 409600
174187874 jyt0217 B Oct. 1, 2022, 1:34 a.m. OK GNU C++14 TESTS 92 62 819200
174191810 le0n B Oct. 1, 2022, 2:46 a.m. OK GNU C++14 TESTS 92 62 819200
174164970 Bobocan B Sept. 30, 2022, 6:34 p.m. OK GNU C++17 TESTS 92 15 921600
174178821 abderrazzakNfissi B Sept. 30, 2022, 9:36 p.m. OK GNU C++17 TESTS 92 46 409600
174193730 WBW0923 B Oct. 1, 2022, 3:18 a.m. OK GNU C++17 TESTS 92 46 409600
174188608 XiaoWhy B Oct. 1, 2022, 1:49 a.m. OK GNU C++17 TESTS 92 46 1536000
174161170 mejiamejia B Sept. 30, 2022, 6:11 p.m. OK GNU C++17 TESTS 92 46 1945600
174169378 vakhew1900 B Sept. 30, 2022, 7:14 p.m. OK GNU C++17 TESTS 92 61 819200
174163438 Error_403 B Sept. 30, 2022, 6:24 p.m. OK GNU C++17 TESTS 92 61 819200
174191780 Sodium_Nickel B Oct. 1, 2022, 2:45 a.m. OK GNU C++17 TESTS 92 61 819200
174163150 gaur_abhi524 B Sept. 30, 2022, 6:22 p.m. OK GNU C++17 TESTS 92 61 819200
174178885 Satoru B Sept. 30, 2022, 9:37 p.m. OK GNU C++17 TESTS 92 61 819200
174195934 Freedom__King B Oct. 1, 2022, 3:54 a.m. OK GNU C++17 (64) TESTS 92 15 12595200
174162647 CartesianTree B Sept. 30, 2022, 6:19 p.m. OK GNU C++17 (64) TESTS 92 31 17920000
174177963 anpoli99 B Sept. 30, 2022, 9:18 p.m. OK GNU C++17 (64) TESTS 92 46 409600
174178378 anpoli99 B Sept. 30, 2022, 9:27 p.m. OK GNU C++17 (64) TESTS 92 46 409600
174171074 znhy B Sept. 30, 2022, 7:33 p.m. OK GNU C++17 (64) TESTS 92 46 409600
174164023 Amank2854 B Sept. 30, 2022, 6:27 p.m. OK GNU C++17 (64) TESTS 92 46 409600
174192460 panyanppyy B Oct. 1, 2022, 2:57 a.m. OK GNU C++17 (64) TESTS 92 46 819200
174188787 DjTang B Oct. 1, 2022, 1:52 a.m. OK GNU C++17 (64) TESTS 92 46 819200
174197604 Pecco B Oct. 1, 2022, 4:19 a.m. OK GNU C++17 (64) TESTS 92 46 819200
174197772 Pecco B Oct. 1, 2022, 4:22 a.m. OK GNU C++17 (64) TESTS 92 46 819200
174183073 LLGM B Sept. 30, 2022, 11:38 p.m. OK GNU C++20 (64) TESTS 92 31 0
174180771 UpDownUpDown B Sept. 30, 2022, 10:19 p.m. OK GNU C++20 (64) TESTS 92 31 0
174164916 MOVSES1 B Sept. 30, 2022, 6:34 p.m. OK GNU C++20 (64) TESTS 92 31 409600
174164439 Ali_Rizvi B Sept. 30, 2022, 6:30 p.m. OK GNU C++20 (64) TESTS 92 31 409600
174191937 EmadSamy B Oct. 1, 2022, 2:48 a.m. OK GNU C++20 (64) TESTS 92 31 409600
174200099 PranavAdlinge B Oct. 1, 2022, 4:52 a.m. OK GNU C++20 (64) TESTS 92 31 409600
174169129 madorz B Sept. 30, 2022, 7:11 p.m. OK GNU C++20 (64) TESTS 92 31 819200
174186491 yyyh B Oct. 1, 2022, 1:06 a.m. OK GNU C++20 (64) TESTS 92 31 819200
174174403 _endL B Sept. 30, 2022, 8:19 p.m. OK GNU C++20 (64) TESTS 92 31 819200
174168303 Lextyle B Sept. 30, 2022, 7:03 p.m. OK GNU C++20 (64) TESTS 92 31 819200
174191693 pushkar.lonkar21 B Oct. 1, 2022, 2:43 a.m. OK Java 11 TESTS 92 187 409600
174166461 dheerajchhatanidc B Sept. 30, 2022, 6:46 p.m. OK Java 11 TESTS 92 202 0
174186046 enviornment B Oct. 1, 2022, 12:56 a.m. OK Java 11 TESTS 92 218 0
174167800 tushar19280 B Sept. 30, 2022, 6:58 p.m. OK Java 11 TESTS 92 218 0
174163609 tiger10092002 B Sept. 30, 2022, 6:25 p.m. OK Java 11 TESTS 92 249 41676800
174147410 nbhakar B Sept. 30, 2022, 4:43 p.m. OK Java 11 TESTS 92 280 0
174162860 tiger10092002 B Sept. 30, 2022, 6:21 p.m. OK Java 11 TESTS 92 280 41472000
174174847 vasanthmaharshi B Sept. 30, 2022, 8:26 p.m. OK Java 11 TESTS 92 483 102400
174168682 pl728 B Sept. 30, 2022, 7:06 p.m. OK Java 11 TESTS 92 810 0
174197700 djrfrn B Oct. 1, 2022, 4:21 a.m. OK Java 11 TESTS 92 826 0
174175119 freehandle B Sept. 30, 2022, 8:31 p.m. OK Java 17 TESTS 92 248 1228800
174152909 vivek1401 B Sept. 30, 2022, 4:58 p.m. OK Java 17 TESTS 92 280 1228800
174164700 Eslam_Ahmed B Sept. 30, 2022, 6:32 p.m. OK Java 17 TESTS 92 280 5120000
174151283 garuda5611 B Sept. 30, 2022, 4:54 p.m. OK Java 17 TESTS 92 920 1536000
174205588 BBCavendish B Oct. 1, 2022, 5:56 a.m. OK Java 17 TESTS 92 920 1638400
174182190 dusty.and.rusty B Sept. 30, 2022, 10:58 p.m. OK Java 17 TESTS 92 967 9625600
174192026 Sussykin B Oct. 1, 2022, 2:49 a.m. OK Java 8 TESTS 92 109 0
174174293 P1011 B Sept. 30, 2022, 8:17 p.m. OK Java 8 TESTS 92 140 0
174167552 gagan_6730 B Sept. 30, 2022, 6:56 p.m. OK Java 8 TESTS 92 140 0
174167141 Virendra115 B Sept. 30, 2022, 6:52 p.m. OK Java 8 TESTS 92 140 0
174195264 amit_roy B Oct. 1, 2022, 3:43 a.m. OK Java 8 TESTS 92 155 0
174194945 priyaroy3370 B Oct. 1, 2022, 3:38 a.m. OK Java 8 TESTS 92 155 0
174168897 Unrated_Pritam B Sept. 30, 2022, 7:09 p.m. OK Java 8 TESTS 92 155 0
174168626 Mohamed308 B Sept. 30, 2022, 7:06 p.m. OK Java 8 TESTS 92 155 0
174166504 Virendra115 B Sept. 30, 2022, 6:46 p.m. OK Java 8 TESTS 92 155 0
174166253 Swapniltri B Sept. 30, 2022, 6:44 p.m. OK Java 8 TESTS 92 155 0
174162817 arvindf232 B Sept. 30, 2022, 6:20 p.m. OK Kotlin 1.6 TESTS 92 187 0
174199701 ripity B Oct. 1, 2022, 4:47 a.m. OK Kotlin 1.6 TESTS 92 264 1024000
174147596 komalsatwik2002 B Sept. 30, 2022, 4:44 p.m. OK MS C++ 2017 TESTS 92 623 819200
174165175 tan_delhi B Sept. 30, 2022, 6:36 p.m. OK PyPy 3 TESTS 92 343 10342400
174162027 MohamedHamed123 B Sept. 30, 2022, 6:16 p.m. OK PyPy 3 TESTS 92 389 10854400
174150386 mnkp B Sept. 30, 2022, 4:52 p.m. OK PyPy 3 TESTS 92 436 11980800
174165523 sy-yarik B Sept. 30, 2022, 6:38 p.m. OK PyPy 3 TESTS 92 1965 10854400
174161298 MohamedHamed123 B Sept. 30, 2022, 6:12 p.m. OK PyPy 3 TESTS 92 1981 10854400
174162748 MohamedHamed123 B Sept. 30, 2022, 6:20 p.m. OK PyPy 3 TESTS 92 1996 10854400
174193380 abhipandey9315 B Oct. 1, 2022, 3:12 a.m. OK PyPy 3-64 TESTS 92 171 13516800
174162068 titan23 B Sept. 30, 2022, 6:17 p.m. OK PyPy 3-64 TESTS 92 171 18432000
174165584 Skillful_Wanderer B Sept. 30, 2022, 6:39 p.m. OK PyPy 3-64 TESTS 92 187 13414400
174161007 alive_ak4c B Sept. 30, 2022, 6:10 p.m. OK PyPy 3-64 TESTS 92 202 10854400
174182488 omar.gawdat B Sept. 30, 2022, 11:21 p.m. OK PyPy 3-64 TESTS 92 202 14745600
174188329 hkwu6013 B Oct. 1, 2022, 1:44 a.m. OK PyPy 3-64 TESTS 92 217 13721600
174182665 omar.gawdat B Sept. 30, 2022, 11:26 p.m. OK PyPy 3-64 TESTS 92 218 14745600
174182622 omar.gawdat B Sept. 30, 2022, 11:25 p.m. OK PyPy 3-64 TESTS 92 218 14745600
174187584 bridgekiller B Oct. 1, 2022, 1:29 a.m. OK PyPy 3-64 TESTS 92 233 13721600
174162660 my_brain_sucks B Sept. 30, 2022, 6:19 p.m. OK PyPy 3-64 TESTS 92 233 15052800
174201757 sixthcore B Oct. 1, 2022, 5:14 a.m. OK Python 3 TESTS 92 389 8806400
174166127 Ace_42 B Sept. 30, 2022, 6:43 p.m. OK Python 3 TESTS 92 482 8601600
174185197 mohanned_war B Oct. 1, 2022, 12:36 a.m. OK Python 3 TESTS 92 592 11161600
174161243 MohamedHamed123 B Sept. 30, 2022, 6:12 p.m. OK Python 3 TESTS 92 1029 7782400
174149848 tanmayjagtap B Sept. 30, 2022, 4:50 p.m. OK Python 3 TESTS 92 1029 8601600
174149404 Virus47 B Sept. 30, 2022, 4:49 p.m. OK Python 3 TESTS 92 1029 8601600
174167171 yellow_flash23 B Sept. 30, 2022, 6:52 p.m. OK Python 3 TESTS 92 1044 7782400
174187205 ekasurya1410 B Oct. 1, 2022, 1:21 a.m. OK Python 3 TESTS 92 1044 8806400
174166099 MBRL B Sept. 30, 2022, 6:43 p.m. OK Python 3 TESTS 92 1060 7782400
174152582 21bec036 B Sept. 30, 2022, 4:57 p.m. OK Python 3 TESTS 92 1076 7782400
174189462 Spheniscine B Oct. 1, 2022, 2:04 a.m. OK Rust 2021 TESTS 92 46 1740800
174162507 jcowgill B Sept. 30, 2022, 6:19 p.m. OK Rust 2021 TESTS 92 670 3072000
174187288 bqn B Oct. 1, 2022, 1:22 a.m. OK Rust 2021 TESTS 92 780 4505600
174187418 bqn B Oct. 1, 2022, 1:25 a.m. OK Rust 2021 TESTS 92 795 4505600

remove filters

Back to search problems