Codeforces Round 912 (Div. 2)

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
1903 Codeforces Round 912 (Div. 2) FINISHED False 8100 30461099 Nov. 30, 2023, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12096 ) C Theofanis' Nightmare PROGRAMMING constructive algorithms dp greedy

B'Theofanis easily gets obsessed with problems before going to sleep and often has nightmares about them. To deal with his obsession he visited his doctor, Dr. Emix. In his latest nightmare, he has an array a of size n and wants to divide it into non-empty subarrays ^{ dagger} such that every element is in exactly one of the subarrays. For example, the array [1,-3,7,-6,2,5] can be divided to [1] [-3,7] [-6,2] [5] . The Cypriot value of such division is equal to Sigma_{i=1}^{k} i cdot mathrm{sum}_i where k is the number of subarrays that we divided the array into and mathrm{sum}_i is the sum of the i -th subarray. The Cypriot value of this division of the array [1] [-3,7] [-6,2] [5] = 1 cdot 1 + 2 cdot (-3 + 7) + 3 cdot (-6 + 2) + 4 cdot 5 = 17 . Theofanis is wondering what is the maximum Cypriot value of any division of the array. ^{ dagger} An array b is a subarray of an array a if b can be obtained from a by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. In particular, an array is a subarray of itself. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case consists of two lines. The first line of each test case contains a single integer n ( 1 <= n <= 10^{5} ) -- the size of the array. The second line contains n integers a_1, a_2, ldots, a_n ( -10^8 <= a_i <= 10^{8} ) -- the elements of the array. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^{5} . For each test case, print one integer -- the maximum Cypriot value of the array a . In the first test case, to get the maximum Cypriot value we divide the array into [1][-3][7][-6][2][5] which gives us: Sigma_{i=1}^{k} i cdot mathrm{sum}_i = 1 cdot 1 + 2 cdot (-3) + 3 '...

Tutorials

Codeforces Round #912 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
235122807 ksandr1v C Nov. 30, 2023, 6:21 p.m. OK C# 10 TESTS 15 93 5836800
235146718 AnnaElli C Nov. 30, 2023, 10:07 p.m. OK C# 10 TESTS 15 108 18739200
235123462 Alfafox C Nov. 30, 2023, 6:23 p.m. OK C# 10 TESTS 15 124 22323200
235140151 NenadDapic C Nov. 30, 2023, 8:27 p.m. OK FPC TESTS 15 62 921600
235139670 ruban C Nov. 30, 2023, 8:22 p.m. OK FPC TESTS 15 62 29798400
235115905 SimonLi12138 C Nov. 30, 2023, 5:56 p.m. OK GNU C11 TESTS 15 62 2457600
235170359 Calvin65 C Dec. 1, 2023, 5:31 a.m. OK GNU C11 TESTS 15 78 819200
235139515 Miracle_Z C Nov. 30, 2023, 8:20 p.m. OK GNU C++14 TESTS 15 62 409600
235161845 anand_patel_91 C Dec. 1, 2023, 3:34 a.m. OK GNU C++14 TESTS 15 62 409600
235170766 dangminhhoangdz C Dec. 1, 2023, 5:36 a.m. OK GNU C++14 TESTS 15 62 409600
235149343 Nishan_sarkar C Nov. 30, 2023, 11:09 p.m. OK GNU C++14 TESTS 15 62 819200
235146759 Complexity_Cutter C Nov. 30, 2023, 10:08 p.m. OK GNU C++14 TESTS 15 62 819200
235129513 vada_pav C Nov. 30, 2023, 6:46 p.m. OK GNU C++14 TESTS 15 62 819200
235115547 Akash_Bhardwaj_ C Nov. 30, 2023, 5:55 p.m. OK GNU C++14 TESTS 15 62 819200
235167504 redquasar C Dec. 1, 2023, 4:59 a.m. OK GNU C++14 TESTS 15 62 819200
235153847 _acsm_ C Dec. 1, 2023, 1:07 a.m. OK GNU C++14 TESTS 15 62 819200
235171822 vitthalnamdev C Dec. 1, 2023, 5:46 a.m. OK GNU C++14 TESTS 15 62 1228800
235126087 verywater C Nov. 30, 2023, 6:33 p.m. OK GNU C++17 TESTS 15 46 1228800
235160117 KAUSTUBH152003 C Dec. 1, 2023, 3:09 a.m. OK GNU C++17 TESTS 15 46 10035200
235170248 ramG_reddy C Dec. 1, 2023, 5:30 a.m. OK GNU C++17 TESTS 15 61 819200
235114512 snacache C Nov. 30, 2023, 5:51 p.m. OK GNU C++17 TESTS 15 61 1638400
235136168 VatsLakshya C Nov. 30, 2023, 7:48 p.m. OK GNU C++17 TESTS 15 62 409600
235125008 warril C Nov. 30, 2023, 6:29 p.m. OK GNU C++17 TESTS 15 62 409600
235137696 Intellegent C Nov. 30, 2023, 8:01 p.m. OK GNU C++17 TESTS 15 62 409600
235137499 alimzhanludoed C Nov. 30, 2023, 7:59 p.m. OK GNU C++17 TESTS 15 62 409600
235167795 wust-zzl C Dec. 1, 2023, 5:03 a.m. OK GNU C++17 TESTS 15 62 819200
235169512 Nhrot C Dec. 1, 2023, 5:22 a.m. OK GNU C++17 TESTS 15 62 819200
235151378 N_z__ C Dec. 1, 2023, 12:07 a.m. OK GNU C++17 (64) TESTS 15 15 921600
235138452 ansh737 C Nov. 30, 2023, 8:09 p.m. OK GNU C++17 (64) TESTS 15 46 409600
235139192 nakka.bhuvith C Nov. 30, 2023, 8:17 p.m. OK GNU C++17 (64) TESTS 15 46 409600
235155895 fs20091003 C Dec. 1, 2023, 1:50 a.m. OK GNU C++17 (64) TESTS 15 46 409600
235144270 dqu1087 C Nov. 30, 2023, 9:20 p.m. OK GNU C++17 (64) TESTS 15 46 409600
235166340 9756 C Dec. 1, 2023, 4:43 a.m. OK GNU C++17 (64) TESTS 15 46 819200
235166415 9756 C Dec. 1, 2023, 4:44 a.m. OK GNU C++17 (64) TESTS 15 46 819200
235162818 idle-person C Dec. 1, 2023, 3:48 a.m. OK GNU C++17 (64) TESTS 15 46 819200
235151780 User_Carrot C Dec. 1, 2023, 12:19 a.m. OK GNU C++17 (64) TESTS 15 46 819200
235143801 shahpriyal2002 C Nov. 30, 2023, 9:13 p.m. OK GNU C++17 (64) TESTS 15 46 819200
235161590 _Golem_ C Dec. 1, 2023, 3:30 a.m. OK GNU C++20 (64) TESTS 15 15 1740800
235151433 cmk666 C Dec. 1, 2023, 12:08 a.m. OK GNU C++20 (64) TESTS 15 15 1740800
235141845 Omar_Fakhry C Nov. 30, 2023, 8:47 p.m. OK GNU C++20 (64) TESTS 15 31 409600
235140119 Saso_192003 C Nov. 30, 2023, 8:26 p.m. OK GNU C++20 (64) TESTS 15 31 409600
235137880 rishabhdeepsingh C Nov. 30, 2023, 8:03 p.m. OK GNU C++20 (64) TESTS 15 31 409600
235135814 vahmad C Nov. 30, 2023, 7:44 p.m. OK GNU C++20 (64) TESTS 15 31 409600
235117701 Modar139 C Nov. 30, 2023, 6:02 p.m. OK GNU C++20 (64) TESTS 15 31 409600
235165047 Ras_Vz C Dec. 1, 2023, 4:23 a.m. OK GNU C++20 (64) TESTS 15 31 409600
235155451 abdulla.bin.ah C Dec. 1, 2023, 1:40 a.m. OK GNU C++20 (64) TESTS 15 31 409600
235172384 MnTm C Dec. 1, 2023, 5:51 a.m. OK GNU C++20 (64) TESTS 15 31 819200
235133605 katomasao C Nov. 30, 2023, 7:31 p.m. OK Haskell TESTS 15 124 25292800
235124686 newbornLingling0423 C Nov. 30, 2023, 6:28 p.m. OK Java 11 TESTS 15 342 0
235152486 PlayDate C Dec. 1, 2023, 12:35 a.m. OK Java 11 TESTS 15 436 0
235152196 RkRohitKumar C Dec. 1, 2023, 12:28 a.m. OK Java 11 TESTS 15 436 0
235120386 muskan05gupta C Nov. 30, 2023, 6:12 p.m. OK Java 11 TESTS 15 483 0
235119057 arnav_gupta C Nov. 30, 2023, 6:07 p.m. OK Java 11 TESTS 15 514 0
235122641 man-ray C Nov. 30, 2023, 6:20 p.m. OK Java 11 TESTS 15 530 0
235125674 FedBear C Nov. 30, 2023, 6:32 p.m. OK Java 11 TESTS 15 608 0
235158307 zo56565 C Dec. 1, 2023, 2:39 a.m. OK Java 17 TESTS 15 233 819200
235140354 ManasR_2003 C Nov. 30, 2023, 8:29 p.m. OK Java 17 TESTS 15 234 42905600
235124903 Jagnath_Reddy C Nov. 30, 2023, 6:29 p.m. OK Java 17 TESTS 15 249 819200
235166332 tirthgohil1410 C Dec. 1, 2023, 4:42 a.m. OK Java 17 TESTS 15 249 1331200
235146228 CutSandstone C Nov. 30, 2023, 9:56 p.m. OK Java 17 TESTS 15 249 4710400
235136178 tiger3768 C Nov. 30, 2023, 7:48 p.m. OK Java 17 TESTS 15 264 1126400
235144587 aishwarykesarwani C Nov. 30, 2023, 9:25 p.m. OK Java 17 TESTS 15 264 1433600
235169845 Liiii C Dec. 1, 2023, 5:26 a.m. OK Java 17 TESTS 15 265 1024000
235170937 TopCloser C Dec. 1, 2023, 5:37 a.m. OK Java 17 TESTS 15 280 5324800
235155065 dilshar23 C Dec. 1, 2023, 1:33 a.m. OK Java 17 TESTS 15 296 5222400
235114458 mcrash12 C Nov. 30, 2023, 5:51 p.m. OK Java 21 TESTS 15 312 1024000
235128540 karangangwar341 C Nov. 30, 2023, 6:43 p.m. OK Java 21 TESTS 15 608 1433600
235171176 Menos C Dec. 1, 2023, 5:39 a.m. OK Java 21 TESTS 15 624 614400
235133552 RatanK C Nov. 30, 2023, 7:31 p.m. OK Java 21 TESTS 15 639 512000
235127161 Valkyrie.. C Nov. 30, 2023, 6:37 p.m. OK Java 21 TESTS 15 779 15257600
235150742 sary-bala C Nov. 30, 2023, 11:49 p.m. OK Java 8 TESTS 15 108 0
235150412 Abusseiit C Nov. 30, 2023, 11:40 p.m. OK Java 8 TESTS 15 108 0
235150390 sary-bala C Nov. 30, 2023, 11:39 p.m. OK Java 8 TESTS 15 108 0
235139452 golions C Nov. 30, 2023, 8:20 p.m. OK Java 8 TESTS 15 140 0
235145159 NerfThis C Nov. 30, 2023, 9:35 p.m. OK Java 8 TESTS 15 140 3481600
235146274 NerfThis C Nov. 30, 2023, 9:56 p.m. OK Java 8 TESTS 15 155 2764800
235124329 nikhil97agra C Nov. 30, 2023, 6:27 p.m. OK Java 8 TESTS 15 155 3686400
235164474 formidablechief_27 C Dec. 1, 2023, 4:14 a.m. OK Java 8 TESTS 15 171 9318400
235115403 EliudGarcia2004 C Nov. 30, 2023, 5:54 p.m. OK Java 8 TESTS 15 343 5427200
235128960 dev22_sharma C Nov. 30, 2023, 6:44 p.m. OK Java 8 TESTS 15 483 0
235147110 zxcuser1 C Nov. 30, 2023, 10:16 p.m. OK MS C++ 2017 TESTS 15 171 819200
235159472 magician_Y C Dec. 1, 2023, 2:58 a.m. OK MS C++ 2017 TESTS 15 187 1228800
235118263 0x1geN C Nov. 30, 2023, 6:04 p.m. OK MS C++ 2017 TESTS 15 187 3174400
235156855 Aneeba C Dec. 1, 2023, 2:12 a.m. OK MS C++ 2017 TESTS 15 202 1638400
235117710 arssmol1029 C Nov. 30, 2023, 6:02 p.m. OK MS C++ 2017 TESTS 15 202 2560000
235125236 kotprogrammist C Nov. 30, 2023, 6:30 p.m. OK MS C++ 2017 TESTS 15 218 1638400
235125184 21r01a05j9 C Nov. 30, 2023, 6:30 p.m. OK MS C++ 2017 TESTS 15 218 2048000
235118644 21r01a05e6 C Nov. 30, 2023, 6:05 p.m. OK MS C++ 2017 TESTS 15 218 2048000
235138812 ahtoh_ C Nov. 30, 2023, 8:13 p.m. OK Node.js TESTS 15 202 49254400
235125239 NK44 C Nov. 30, 2023, 6:30 p.m. OK PyPy 3 TESTS 15 343 23244800
235130039 ErikUsmanov C Nov. 30, 2023, 6:48 p.m. OK PyPy 3 TESTS 15 421 13619200
235165624 lisashi C Dec. 1, 2023, 4:32 a.m. OK PyPy 3 TESTS 15 436 23244800
235116271 Jimmily C Nov. 30, 2023, 5:57 p.m. OK PyPy 3 TESTS 15 436 25497600
235133921 garyyaoresearch C Nov. 30, 2023, 7:32 p.m. OK PyPy 3 TESTS 15 451 13721600
235125989 avacado6 C Nov. 30, 2023, 6:33 p.m. OK PyPy 3 TESTS 15 451 27033600
235114200 vedant.kokate C Nov. 30, 2023, 5:50 p.m. OK PyPy 3 TESTS 15 468 25497600
235124974 ASaltyPepper C Nov. 30, 2023, 6:29 p.m. OK PyPy 3 TESTS 15 483 31334400
235119530 noob_username C Nov. 30, 2023, 6:09 p.m. OK PyPy 3 TESTS 15 607 32768000
235122834 prasham15 C Nov. 30, 2023, 6:21 p.m. OK PyPy 3-64 TESTS 15 124 18432000
235169102 smdbs C Dec. 1, 2023, 5:18 a.m. OK PyPy 3-64 TESTS 15 124 19148800
235140228 titia C Nov. 30, 2023, 8:28 p.m. OK PyPy 3-64 TESTS 15 124 19456000
235140777 DRDIV C Nov. 30, 2023, 8:34 p.m. OK PyPy 3-64 TESTS 15 124 20889600
235154848 StacGnihsihp C Dec. 1, 2023, 1:28 a.m. OK PyPy 3-64 TESTS 15 124 21094400
235167061 sagarpal1909 C Dec. 1, 2023, 4:53 a.m. OK PyPy 3-64 TESTS 15 124 22732800
235120093 notChidi C Nov. 30, 2023, 6:11 p.m. OK PyPy 3-64 TESTS 15 124 23449600
235138090 Lotrick C Nov. 30, 2023, 8:05 p.m. OK PyPy 3-64 TESTS 15 124 149504000
235127242 nonam33 C Nov. 30, 2023, 6:38 p.m. OK PyPy 3-64 TESTS 15 139 17612800
235117028 SoleProprietor C Nov. 30, 2023, 6 p.m. OK PyPy 3-64 TESTS 15 139 17715200
235126205 prakku_2634 C Nov. 30, 2023, 6:33 p.m. OK Python 3 TESTS 15 155 17817600
235154867 InfinitePath C Dec. 1, 2023, 1:29 a.m. OK Python 3 TESTS 15 155 24268800
235127108 v1ncent2 C Nov. 30, 2023, 6:37 p.m. OK Python 3 TESTS 15 186 17817600
235147906 Coder_Green C Nov. 30, 2023, 10:34 p.m. OK Python 3 TESTS 15 187 17817600
235126623 Via._.Vai C Nov. 30, 2023, 6:35 p.m. OK Python 3 TESTS 15 233 17100800
235130021 younohu C Nov. 30, 2023, 6:47 p.m. OK Python 3 TESTS 15 233 23142400
235117941 YURAsuki C Nov. 30, 2023, 6:03 p.m. OK Python 3 TESTS 15 233 23859200
235120639 fraxea C Nov. 30, 2023, 6:13 p.m. OK Python 3 TESTS 15 249 23756800
235122040 Muntaba07 C Nov. 30, 2023, 6:18 p.m. OK Python 3 TESTS 15 249 27545600
235136387 sarojvihung C Nov. 30, 2023, 7:49 p.m. OK Python 3 TESTS 15 265 22732800
235154739 Sparkle_Twilight C Dec. 1, 2023, 1:26 a.m. OK Ruby 3 TESTS 15 607 29388800
235147789 chromate00 C Nov. 30, 2023, 10:31 p.m. OK Ruby 3 TESTS 15 607 29388800
235124691 jashkayth_174 C Nov. 30, 2023, 6:28 p.m. OK Ruby 3 TESTS 15 951 58880000
235140862 jyom C Nov. 30, 2023, 8:35 p.m. OK Rust 2021 TESTS 15 77 4198400
235141734 vstiff C Nov. 30, 2023, 8:45 p.m. OK Rust 2021 TESTS 15 124 4198400
235123104 Loganwick C Nov. 30, 2023, 6:22 p.m. OK Rust 2021 TESTS 15 124 5529600
235120379 _a253 C Nov. 30, 2023, 6:12 p.m. OK Rust 2021 TESTS 15 140 10035200

remove filters

Back to search problems