Codeforces Round 888 (Div. 3)

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
1851 Codeforces Round 888 (Div. 3) FINISHED False 8100 41527499 July 25, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15386 ) D Prefix Permutation Sums PROGRAMMING implementation math

B'Your friends have an array of n elements, calculated its array of prefix sums and passed it to you, accidentally losing one element during the transfer. Your task is to find out if the given array can matches permutation. A permutation of n elements is an array of n numbers from 1 to n such that each number occurs exactly one times in it. The array of prefix sums of the array a -- is such an array b that b_i = sum_{j=1}^i a_j, 1 <= i <= n . For example, the original permutation was [1, 5, 2, 4, 3] . Its array of prefix sums -- [1, 6, 8, 12, 15] . Having lost one element, you can get, for example, arrays [6, 8, 12, 15] or [1, 6, 8, 15] . It can also be shown that the array [1, 2, 100] does not correspond to any permutation. The first line contains a positive number t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of the description of each test case contains a positive number n ( 2 <= n <= 2 cdot 10^5 ) -- the size of the initial array. The second line of the description of each test case contains n - 1 positive number a_i ( 1 <= a_i <= 10^{18} ), a_{i-1} < a_i -- elements of the array of prefix sums. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output "YES" if such a permutation exists, and "NO" otherwise. You can output "YES" and "NO" in any case (for example, the strings "yEs", "yes" and "Yes" will be recognized as a positive response). In the fourth example, for example, the permutation [1, 2, 3, 4] is suitable. In the fifth example, for example, the permutation [2, 1] is suitable. In the seventh example, for example, the permutation [1, 2, 4, 3] is suitable. '...

Tutorials

118667

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
215652363 prattay56 D July 25, 2023, 10:44 p.m. OK GNU C11 TESTS 10 62 4812800
215621670 iffatul_anon D July 25, 2023, 4:56 p.m. OK GNU C11 TESTS 10 62 4812800
215657697 You__Know__Who__ D July 26, 2023, 1:08 a.m. OK GNU C++14 TESTS 10 61 3174400
215621083 MahmoudAttia D July 25, 2023, 4:54 p.m. OK GNU C++14 TESTS 10 62 1638400
215671049 chenyanxi D July 26, 2023, 3:59 a.m. OK GNU C++14 TESTS 10 62 2457600
215675602 xizhao D July 26, 2023, 5:02 a.m. OK GNU C++14 TESTS 10 62 3174400
215680664 YYDSAO D July 26, 2023, 6:01 a.m. OK GNU C++14 TESTS 10 62 5632000
215632118 laullelien D July 25, 2023, 6 p.m. OK GNU C++14 TESTS 10 77 819200
215659412 XiaoSuan250 D July 26, 2023, 1:33 a.m. OK GNU C++14 TESTS 10 77 1638400
215667445 wangwei0134 D July 26, 2023, 3:15 a.m. OK GNU C++14 TESTS 10 77 3174400
215632173 sankit1999 D July 25, 2023, 6 p.m. OK GNU C++14 TESTS 10 77 3174400
215634065 omeganot D July 25, 2023, 6:16 p.m. OK GNU C++14 TESTS 10 77 3993600
215647311 expertaq D July 25, 2023, 9:01 p.m. OK GNU C++17 TESTS 10 62 3174400
215627880 ygngzln D July 25, 2023, 5:28 p.m. OK GNU C++17 TESTS 10 77 1638400
215625118 Yashh007 D July 25, 2023, 5:11 p.m. OK GNU C++17 TESTS 10 77 1638400
215672722 AMO5 D July 26, 2023, 4:22 a.m. OK GNU C++17 TESTS 10 77 2457600
215651245 s.keshav D July 25, 2023, 10:16 p.m. OK GNU C++17 TESTS 10 77 2457600
215665625 weaknesse D July 26, 2023, 2:55 a.m. OK GNU C++17 TESTS 10 77 3174400
215664589 jacksparr0w D July 26, 2023, 2:43 a.m. OK GNU C++17 TESTS 10 77 3174400
215652638 aniketjaiswal_iitp D July 25, 2023, 10:50 p.m. OK GNU C++17 TESTS 10 77 3174400
215670014 kalmeakash D July 26, 2023, 3:47 a.m. OK GNU C++17 TESTS 10 77 3174400
215666636 nvminhTDMU D July 26, 2023, 3:06 a.m. OK GNU C++17 TESTS 10 77 3174400
215663994 SugarT D July 26, 2023, 2:35 a.m. OK GNU C++17 (64) TESTS 10 46 1638400
215665198 cheng1202 D July 26, 2023, 2:49 a.m. OK GNU C++17 (64) TESTS 10 46 1843200
215650107 M0N D July 25, 2023, 9:50 p.m. OK GNU C++17 (64) TESTS 10 46 1843200
215668046 jzr D July 26, 2023, 3:22 a.m. OK GNU C++17 (64) TESTS 10 46 2457600
215620672 SandAuddy755 D July 25, 2023, 4:53 p.m. OK GNU C++17 (64) TESTS 10 46 3174400
215666647 vjudge4 D July 26, 2023, 3:06 a.m. OK GNU C++17 (64) TESTS 10 46 3584000
215666615 Summmmer D July 26, 2023, 3:05 a.m. OK GNU C++17 (64) TESTS 10 46 3584000
215660282 yingziYe D July 26, 2023, 1:46 a.m. OK GNU C++17 (64) TESTS 10 46 5836800
215650901 nibirjoydhar D July 25, 2023, 10:07 p.m. OK GNU C++17 (64) TESTS 10 46 5836800
215668031 kataresrihari D July 26, 2023, 3:22 a.m. OK GNU C++17 (64) TESTS 10 46 6656000
215622588 Wangsss D July 25, 2023, 5 p.m. OK GNU C++20 (64) TESTS 10 31 0
215639172 A7med_Nage7 D July 25, 2023, 7:10 p.m. OK GNU C++20 (64) TESTS 10 31 204800
215656229 r01234 D July 26, 2023, 12:36 a.m. OK GNU C++20 (64) TESTS 10 31 1638400
215651145 Fares_Magd D July 25, 2023, 10:14 p.m. OK GNU C++20 (64) TESTS 10 31 1638400
215627810 milkyghoul D July 25, 2023, 5:27 p.m. OK GNU C++20 (64) TESTS 10 31 1638400
215622394 flowing D July 25, 2023, 4:59 p.m. OK GNU C++20 (64) TESTS 10 31 1638400
215678414 Cdo D July 26, 2023, 5:36 a.m. OK GNU C++20 (64) TESTS 10 31 1638400
215673493 BC_Khanh D July 26, 2023, 4:34 a.m. OK GNU C++20 (64) TESTS 10 31 1638400
215671479 AJinGoo D July 26, 2023, 4:05 a.m. OK GNU C++20 (64) TESTS 10 31 2457600
215676599 zzkkyy D July 26, 2023, 5:14 a.m. OK GNU C++20 (64) TESTS 10 31 2457600
215628731 ghostikgh D July 25, 2023, 5:34 p.m. OK Go TESTS 10 77 24780800
215645207 dzhi D July 25, 2023, 8:32 p.m. OK Java 11 TESTS 10 233 4915200
215673244 Still. D July 26, 2023, 4:30 a.m. OK Java 11 TESTS 10 264 4915200
215675196 dark_rays D July 26, 2023, 4:57 a.m. OK Java 11 TESTS 10 264 5017600
215636207 Abdelrahman.Salah D July 25, 2023, 6:36 p.m. OK Java 11 TESTS 10 264 13824000
215633941 princeayush04 D July 25, 2023, 6:15 p.m. OK Java 11 TESTS 10 311 20070400
215628206 Hsharma D July 25, 2023, 5:30 p.m. OK Java 11 TESTS 10 342 16384000
215659640 Mustela_Erminea D July 26, 2023, 1:37 a.m. OK Java 11 TESTS 10 436 20684800
215661868 lihanyu D July 26, 2023, 2:09 a.m. OK Java 11 TESTS 10 514 0
215632969 dineshsharmanit7 D July 25, 2023, 6:07 p.m. OK Java 11 TESTS 10 545 0
215626354 WhatAGod D July 25, 2023, 5:18 p.m. OK Java 11 TESTS 10 592 4812800
215673788 jiangqiao D July 26, 2023, 4:38 a.m. OK Java 17 TESTS 10 280 5427200
215636352 Abdelrahim303 D July 25, 2023, 6:37 p.m. OK Java 17 TESTS 10 280 6963200
215634647 mcrash12 D July 25, 2023, 6:21 p.m. OK Java 17 TESTS 10 311 5222400
215621802 Ashwani_Y D July 25, 2023, 4:57 p.m. OK Java 17 TESTS 10 342 20070400
215669171 kenkapo D July 26, 2023, 3:36 a.m. OK Java 17 TESTS 10 342 31641600
215626698 2745810964z D July 25, 2023, 5:20 p.m. OK Java 17 TESTS 10 343 22323200
215623275 _ryan18_ D July 25, 2023, 5:02 p.m. OK Java 17 TESTS 10 374 24166400
215621538 Hawater D July 25, 2023, 4:56 p.m. OK Java 17 TESTS 10 374 39936000
215624326 HMETAO D July 25, 2023, 5:07 p.m. OK Java 17 TESTS 10 389 21913600
215628248 2745810964z D July 25, 2023, 5:30 p.m. OK Java 17 TESTS 10 389 30515200
215625547 292_KJ D July 25, 2023, 5:13 p.m. OK Java 8 TESTS 10 124 0
215665579 mohamedhassan_c D July 26, 2023, 2:54 a.m. OK Java 8 TESTS 10 155 26112000
215641679 Harwinvanak D July 25, 2023, 7:39 p.m. OK Java 8 TESTS 10 171 0
215671584 bleach__ D July 26, 2023, 4:06 a.m. OK Java 8 TESTS 10 202 100147200
215680635 Tomatos03 D July 26, 2023, 6:01 a.m. OK Java 8 TESTS 10 265 24166400
215672124 formidablechief_27 D July 26, 2023, 4:14 a.m. OK Java 8 TESTS 10 265 29798400
215636446 6thSense D July 25, 2023, 6:38 p.m. OK Java 8 TESTS 10 311 24064000
215643861 vatsal_04 D July 25, 2023, 8:14 p.m. OK Java 8 TESTS 10 343 13516800
215677464 priyaroy3370 D July 26, 2023, 5:24 a.m. OK Java 8 TESTS 10 452 4915200
215678003 yashhingwe D July 26, 2023, 5:30 a.m. OK Java 8 TESTS 10 452 11161600
215632964 gelbelachente D July 25, 2023, 6:07 p.m. OK Kotlin 1.7 TESTS 10 748 61337600
215680069 time_x D July 26, 2023, 5:55 a.m. OK MS C++ 2017 TESTS 10 78 3379200
215626453 sdjzu2333 D July 25, 2023, 5:18 p.m. OK MS C++ 2017 TESTS 10 93 16076800
215639357 maxK99 D July 25, 2023, 7:12 p.m. OK MS C++ 2017 TESTS 10 249 204800
215620950 Galina_Basalova D July 25, 2023, 4:54 p.m. OK MS C++ 2017 TESTS 10 249 3174400
215671299 Mohamed_Ragab123321 D July 26, 2023, 4:02 a.m. OK MS C++ 2017 TESTS 10 265 3276800
215662520 mxdwj D July 26, 2023, 2:17 a.m. OK MS C++ 2017 TESTS 10 280 819200
215625191 tatianyi D July 25, 2023, 5:11 p.m. OK MS C++ 2017 TESTS 10 327 15052800
215628194 Dylag D July 25, 2023, 5:30 p.m. OK MS C++ 2017 TESTS 10 327 17203200
215622425 Yergali D July 25, 2023, 4:59 p.m. OK PyPy 3 TESTS 10 280 49664000
215628184 codeiitd D July 25, 2023, 5:30 p.m. OK PyPy 3 TESTS 10 420 27648000
215620369 vaibhav2740 D July 25, 2023, 4:52 p.m. OK PyPy 3 TESTS 10 482 31948800
215645457 urparvezali D July 25, 2023, 8:35 p.m. OK PyPy 3 TESTS 10 482 35737600
215651104 grente D July 25, 2023, 10:13 p.m. OK PyPy 3 TESTS 10 499 35123200
215668164 JavaGodPeter D July 26, 2023, 3:24 a.m. OK PyPy 3 TESTS 10 514 36659200
215631913 2momo2 D July 25, 2023, 5:58 p.m. OK PyPy 3 TESTS 10 530 36352000
215650823 Thinkerman D July 25, 2023, 10:05 p.m. OK PyPy 3 TESTS 10 608 49459200
215654122 adu_alt D July 25, 2023, 11:35 p.m. OK PyPy 3 TESTS 10 919 46796800
215624839 Hoshino_kongum D July 25, 2023, 5:10 p.m. OK PyPy 3-64 TESTS 10 139 33894400
215641197 injust D July 25, 2023, 7:33 p.m. OK PyPy 3-64 TESTS 10 140 33280000
215641022 injust D July 25, 2023, 7:31 p.m. OK PyPy 3-64 TESTS 10 140 38297600
215635664 person_exe D July 25, 2023, 6:30 p.m. OK PyPy 3-64 TESTS 10 140 39219200
215635390 person_exe D July 25, 2023, 6:27 p.m. OK PyPy 3-64 TESTS 10 155 33075200
215624447 plshelpme D July 25, 2023, 5:08 p.m. OK PyPy 3-64 TESTS 10 155 33280000
215635159 person_exe D July 25, 2023, 6:25 p.m. OK PyPy 3-64 TESTS 10 156 34713600
215676568 MistaFlash D July 26, 2023, 5:13 a.m. OK PyPy 3-64 TESTS 10 171 32460800
215628023 rmr D July 25, 2023, 5:29 p.m. OK PyPy 3-64 TESTS 10 171 35942400
215632358 sravansainath7980 D July 25, 2023, 6:01 p.m. OK PyPy 3-64 TESTS 10 171 36556800
215673435 NS3081992 D July 26, 2023, 4:33 a.m. OK Python 3 TESTS 10 108 28569600
215673003 NS3081992 D July 26, 2023, 4:27 a.m. OK Python 3 TESTS 10 139 29696000
215657769 commonsense D July 26, 2023, 1:09 a.m. OK Python 3 TESTS 10 140 30822400
215635642 person_exe D July 25, 2023, 6:30 p.m. OK Python 3 TESTS 10 155 29900800
215664119 aureg109 D July 26, 2023, 2:37 a.m. OK Python 3 TESTS 10 155 31641600
215664070 aureg109 D July 26, 2023, 2:36 a.m. OK Python 3 TESTS 10 155 34713600
215676414 NoLongerHuman D July 26, 2023, 5:12 a.m. OK Python 3 TESTS 10 170 30924800
215620754 jinaypanchal98 D July 25, 2023, 4:53 p.m. OK Python 3 TESTS 10 170 31436800
215673805 chum4kov D July 26, 2023, 4:39 a.m. OK Python 3 TESTS 10 186 30720000
215676210 Md.Salam_Uddin D July 26, 2023, 5:09 a.m. OK Python 3 TESTS 10 186 30924800

remove filters

Back to search problems