Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022

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
1726 Codeforces Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 FINISHED False 8100 74791463 Sept. 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23276 ) A Mainak and Array PROGRAMMING greedy math #groups

B'Mainak has an array a_1, a_2, ldots, a_n of n positive integers. He will do the following operation to this array exactly once: Mainak wants to maximize the value of (a_n - a_1) after exactly one such operation. Determine the maximum value of (a_n - a_1) that he can obtain. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 50 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 2000 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 999 ). It is guaranteed that the sum of n over all test cases does not exceed 2000 . For each test case, output a single integer -- the maximum value of (a_n - a_1) that Mainak can obtain by doing the operation exactly once. '...

Tutorials

Codeforces Round #819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
171192260 azukun A Sept. 7, 2022, 4:39 a.m. OK C# 10 TESTS 26 108 409600
171191273 Muhammad.exe A Sept. 7, 2022, 4:19 a.m. OK C# 10 TESTS 26 108 409600
171191082 Muhammad.exe A Sept. 7, 2022, 4:16 a.m. OK C# 10 TESTS 26 124 409600
171147515 ruban A Sept. 6, 2022, 4:42 p.m. OK Delphi TESTS 26 139 40550400
171156001 Devesh._.Gautam A Sept. 6, 2022, 5:55 p.m. OK GNU C11 TESTS 26 15 0
171190555 CodingCoding104 A Sept. 7, 2022, 4:07 a.m. OK GNU C11 TESTS 26 15 0
171161675 pradeepc A Sept. 6, 2022, 6:39 p.m. OK GNU C11 TESTS 26 15 0
171173789 DarkT A Sept. 6, 2022, 9:31 p.m. OK GNU C11 TESTS 26 15 0
171176239 0xOnyx A Sept. 6, 2022, 10:29 p.m. OK GNU C11 TESTS 26 15 204800
171175133 Nothing_007 A Sept. 6, 2022, 10:02 p.m. OK GNU C11 TESTS 26 30 0
171185835 abdullah__92 A Sept. 7, 2022, 2:26 a.m. OK GNU C11 TESTS 26 30 0
171154502 SP2003 A Sept. 6, 2022, 5:48 p.m. OK GNU C11 TESTS 26 30 0
171177218 Hantur A Sept. 6, 2022, 10:54 p.m. OK GNU C11 TESTS 26 30 0
171142779 sunil3319 A Sept. 6, 2022, 4:30 p.m. OK GNU C11 TESTS 26 30 204800
171183575 Kiritosi A Sept. 7, 2022, 1:38 a.m. OK GNU C++14 TESTS 26 0 0
171180154 VVsxmja A Sept. 7, 2022, 12:15 a.m. OK GNU C++14 TESTS 26 0 0
171180755 kuldeepkushwaha A Sept. 7, 2022, 12:31 a.m. OK GNU C++14 TESTS 26 0 102400
171157377 wildfire032 A Sept. 6, 2022, 6:05 p.m. OK GNU C++14 TESTS 26 0 1638400
171196089 WR_Eternity_ A Sept. 7, 2022, 5:42 a.m. OK GNU C++14 TESTS 26 15 0
171192875 Pro_Coder_Masud A Sept. 7, 2022, 4:51 a.m. OK GNU C++14 TESTS 26 15 0
171193192 liguofu A Sept. 7, 2022, 4:56 a.m. OK GNU C++14 TESTS 26 15 0
171193560 Sristi_Shah A Sept. 7, 2022, 5:02 a.m. OK GNU C++14 TESTS 26 15 0
171193724 vimal2002 A Sept. 7, 2022, 5:05 a.m. OK GNU C++14 TESTS 26 15 0
171196229 human_shu A Sept. 7, 2022, 5:45 a.m. OK GNU C++14 TESTS 26 15 0
171163052 priyanshu.sharma3367 A Sept. 6, 2022, 6:52 p.m. OK GNU C++17 TESTS 26 0 0
171164987 Asib148 A Sept. 6, 2022, 7:13 p.m. OK GNU C++17 TESTS 26 0 0
171165427 Starc15 A Sept. 6, 2022, 7:18 p.m. OK GNU C++17 TESTS 26 0 0
171195367 Akshay_Jyani A Sept. 7, 2022, 5:31 a.m. OK GNU C++17 TESTS 26 0 0
171154868 __shivam_kumar A Sept. 6, 2022, 5:49 p.m. OK GNU C++17 TESTS 26 0 0
171145297 Kanishk_0012 A Sept. 6, 2022, 4:37 p.m. OK GNU C++17 TESTS 26 0 0
171192678 Alok_kr A Sept. 7, 2022, 4:47 a.m. OK GNU C++17 TESTS 26 0 102400
171159419 abhi_ram A Sept. 6, 2022, 6:21 p.m. OK GNU C++17 TESTS 26 0 102400
171156609 richard_bachman A Sept. 6, 2022, 5:59 p.m. OK GNU C++17 TESTS 26 0 102400
171194426 kurai_yume A Sept. 7, 2022, 5:16 a.m. OK GNU C++17 TESTS 26 0 204800
171192886 selphine A Sept. 7, 2022, 4:51 a.m. OK GNU C++17 (64) TESTS 26 0 0
171191875 aditya_yadav A Sept. 7, 2022, 4:33 a.m. OK GNU C++17 (64) TESTS 26 0 0
171185454 Eter.nal A Sept. 7, 2022, 2:17 a.m. OK GNU C++17 (64) TESTS 26 0 0
171185002 Durant_Lee A Sept. 7, 2022, 2:08 a.m. OK GNU C++17 (64) TESTS 26 0 0
171181221 killer_queen4804 A Sept. 7, 2022, 12:43 a.m. OK GNU C++17 (64) TESTS 26 0 0
171166696 opPO A Sept. 6, 2022, 7:32 p.m. OK GNU C++17 (64) TESTS 26 0 0
171165395 vedusoni A Sept. 6, 2022, 7:17 p.m. OK GNU C++17 (64) TESTS 26 0 0
171164334 amansaxena1 A Sept. 6, 2022, 7:05 p.m. OK GNU C++17 (64) TESTS 26 0 0
171159715 AhmedOmani.2003 A Sept. 6, 2022, 6:23 p.m. OK GNU C++17 (64) TESTS 26 0 0
171154590 Lycoriss A Sept. 6, 2022, 5:48 p.m. OK GNU C++17 (64) TESTS 26 0 2457600
171187108 scholar101518 A Sept. 7, 2022, 2:56 a.m. OK GNU C++20 (64) TESTS 26 0 0
171187694 lemonilemon A Sept. 7, 2022, 3:08 a.m. OK GNU C++20 (64) TESTS 26 0 0
171189063 AnAnAnnnn A Sept. 7, 2022, 3:37 a.m. OK GNU C++20 (64) TESTS 26 0 0
171189790 whateverittakes_465 A Sept. 7, 2022, 3:52 a.m. OK GNU C++20 (64) TESTS 26 0 0
171190800 animesh624_20 A Sept. 7, 2022, 4:11 a.m. OK GNU C++20 (64) TESTS 26 0 0
171192868 always_confident A Sept. 7, 2022, 4:50 a.m. OK GNU C++20 (64) TESTS 26 0 0
171193023 taoyangui A Sept. 7, 2022, 4:53 a.m. OK GNU C++20 (64) TESTS 26 0 0
171193272 shamugupta8259 A Sept. 7, 2022, 4:57 a.m. OK GNU C++20 (64) TESTS 26 0 0
171195429 HuyKoCoNy A Sept. 7, 2022, 5:32 a.m. OK GNU C++20 (64) TESTS 26 0 0
171186762 mdjewelrana.cse.pust A Sept. 7, 2022, 2:49 a.m. OK GNU C++20 (64) TESTS 26 0 0
171184123 pepradere A Sept. 7, 2022, 1:50 a.m. OK Go TESTS 26 31 307200
171186694 ryder890 A Sept. 7, 2022, 2:46 a.m. OK Java 11 TESTS 26 155 0
171186237 aamir_1102 A Sept. 7, 2022, 2:35 a.m. OK Java 11 TESTS 26 171 0
171181487 satyaa_78 A Sept. 7, 2022, 12:49 a.m. OK Java 11 TESTS 26 171 0
171164684 Siddharth_Singh_here A Sept. 6, 2022, 7:09 p.m. OK Java 11 TESTS 26 171 0
171159165 Otepbergen A Sept. 6, 2022, 6:18 p.m. OK Java 11 TESTS 26 171 0
171158811 mk_0380 A Sept. 6, 2022, 6:16 p.m. OK Java 11 TESTS 26 171 0
171157200 nis1234 A Sept. 6, 2022, 6:04 p.m. OK Java 11 TESTS 26 171 0
171155945 x21svage A Sept. 6, 2022, 5:55 p.m. OK Java 11 TESTS 26 186 0
171191841 cRuSaDeR A Sept. 7, 2022, 4:32 a.m. OK Java 11 TESTS 26 202 0
171169790 yadavdipesh A Sept. 6, 2022, 8:15 p.m. OK Java 11 TESTS 26 202 0
171174475 YO07 A Sept. 6, 2022, 9:46 p.m. OK Java 17 TESTS 26 187 204800
171189557 ketangupta12 A Sept. 7, 2022, 3:48 a.m. OK Java 17 TESTS 26 202 409600
171169586 Kedrigern A Sept. 6, 2022, 8:12 p.m. OK Java 17 TESTS 26 217 512000
171156584 akashcsanjeev A Sept. 6, 2022, 5:59 p.m. OK Java 17 TESTS 26 233 819200
171166010 rishi2025 A Sept. 6, 2022, 7:25 p.m. OK Java 17 TESTS 26 233 921600
171146931 Sanyam1 A Sept. 6, 2022, 4:41 p.m. OK Java 17 TESTS 26 234 512000
171192187 Kamal_15 A Sept. 7, 2022, 4:38 a.m. OK Java 17 TESTS 26 249 819200
171194334 NS_69b A Sept. 7, 2022, 5:14 a.m. OK Java 17 TESTS 26 280 819200
171158343 tmazumdar A Sept. 6, 2022, 6:12 p.m. OK Java 8 TESTS 26 93 0
171189065 Java_Programmer A Sept. 7, 2022, 3:37 a.m. OK Java 8 TESTS 26 93 0
171184655 chaiku A Sept. 7, 2022, 2:01 a.m. OK Java 8 TESTS 26 93 0
171167378 coder_terror A Sept. 6, 2022, 7:41 p.m. OK Java 8 TESTS 26 93 0
171161252 ac23 A Sept. 6, 2022, 6:35 p.m. OK Java 8 TESTS 26 93 0
171159297 akarshanand2810 A Sept. 6, 2022, 6:20 p.m. OK Java 8 TESTS 26 93 0
171159089 Otepbergen A Sept. 6, 2022, 6:18 p.m. OK Java 8 TESTS 26 93 0
171154771 ankit_0207 A Sept. 6, 2022, 5:49 p.m. OK Java 8 TESTS 26 108 0
171164225 ganesh_6 A Sept. 6, 2022, 7:04 p.m. OK Java 8 TESTS 26 109 0
171190506 kalsitushar A Sept. 7, 2022, 4:06 a.m. OK Java 8 TESTS 26 109 0
171154711 macacod A Sept. 6, 2022, 5:49 p.m. OK Kotlin 1.6 TESTS 26 202 0
171143733 TheGoodest A Sept. 6, 2022, 4:33 p.m. OK MS C++ 2017 TESTS 26 15 0
171192874 sunil210 A Sept. 7, 2022, 4:51 a.m. OK MS C++ 2017 TESTS 26 15 0
171185627 6ziv A Sept. 7, 2022, 2:21 a.m. OK MS C++ 2017 TESTS 26 15 0
171166814 cptahahab A Sept. 6, 2022, 7:33 p.m. OK MS C++ 2017 TESTS 26 15 0
171142916 211053190 A Sept. 6, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 26 15 0
171190300 misaka12435 A Sept. 7, 2022, 4:02 a.m. OK MS C++ 2017 TESTS 26 15 102400
171150216 ntzntz A Sept. 6, 2022, 4:48 p.m. OK MS C++ 2017 TESTS 26 15 40140800
171143976 SofiBorisova A Sept. 6, 2022, 4:33 p.m. OK MS C++ 2017 TESTS 26 30 0
171155096 1_2_3_4_5_9 A Sept. 6, 2022, 5:51 p.m. OK PyPy 2 TESTS 26 109 5836800
171185812 abhipandey9315 A Sept. 7, 2022, 2:25 a.m. OK PyPy 3 TESTS 26 77 1638400
171193080 rajat_7887 A Sept. 7, 2022, 4:54 a.m. OK PyPy 3 TESTS 26 77 1945600
171144280 ah_hemanth_219 A Sept. 6, 2022, 4:34 p.m. OK PyPy 3 TESTS 26 92 1638400
171158655 plevande A Sept. 6, 2022, 6:15 p.m. OK PyPy 3 TESTS 26 93 1536000
171162812 f20210555 A Sept. 6, 2022, 6:50 p.m. OK PyPy 3 TESTS 26 108 1638400
171154596 sdt4936 A Sept. 6, 2022, 5:48 p.m. OK PyPy 3 TESTS 26 108 2355200
171185594 YashNandwana A Sept. 7, 2022, 2:20 a.m. OK PyPy 3 TESTS 26 108 2764800
171174303 crapcode A Sept. 6, 2022, 9:43 p.m. OK PyPy 3-64 TESTS 26 61 1638400
171176213 ASawe2.6Main A Sept. 6, 2022, 10:29 p.m. OK PyPy 3-64 TESTS 26 61 1740800
171160258 AryanSeth A Sept. 6, 2022, 6:27 p.m. OK PyPy 3-64 TESTS 26 61 1945600
171195694 AKumar666 A Sept. 7, 2022, 5:36 a.m. OK PyPy 3-64 TESTS 26 61 1945600
171167963 Vyachik1337 A Sept. 6, 2022, 7:48 p.m. OK PyPy 3-64 TESTS 26 62 1638400
171171620 OmarMoBadr A Sept. 6, 2022, 8:45 p.m. OK PyPy 3-64 TESTS 26 62 1740800
171155894 biglunchdude A Sept. 6, 2022, 5:55 p.m. OK PyPy 3-64 TESTS 26 62 1740800
171150101 SnowPuff A Sept. 6, 2022, 4:48 p.m. OK PyPy 3-64 TESTS 26 62 1740800
171193088 bridgekiller A Sept. 7, 2022, 4:54 a.m. OK PyPy 3-64 TESTS 26 62 1843200
171190593 mohanned_war A Sept. 7, 2022, 4:08 a.m. OK PyPy 3-64 TESTS 26 62 1843200
171164836 khrystyna_dol A Sept. 6, 2022, 7:11 p.m. OK Python 3 TESTS 26 31 0
171189779 ritesh_43 A Sept. 7, 2022, 3:52 a.m. OK Python 3 TESTS 26 46 0
171185742 Shuja_SundarSTEM A Sept. 7, 2022, 2:23 a.m. OK Python 3 TESTS 26 46 0
171185708 Shuja_SundarSTEM A Sept. 7, 2022, 2:22 a.m. OK Python 3 TESTS 26 46 0
171182861 williamcz A Sept. 7, 2022, 1:21 a.m. OK Python 3 TESTS 26 46 0
171180470 happywater A Sept. 7, 2022, 12:24 a.m. OK Python 3 TESTS 26 46 0
171171407 tanaydaga22 A Sept. 6, 2022, 8:41 p.m. OK Python 3 TESTS 26 46 0
171170647 KemalKK A Sept. 6, 2022, 8:29 p.m. OK Python 3 TESTS 26 46 0
171170386 lucbarn A Sept. 6, 2022, 8:24 p.m. OK Python 3 TESTS 26 46 0
171168108 mihir111p A Sept. 6, 2022, 7:50 p.m. OK Python 3 TESTS 26 46 0
171172678 piyushk A Sept. 6, 2022, 9:07 p.m. OK Rust 2021 TESTS 26 15 0
171162985 Tobraef A Sept. 6, 2022, 6:52 p.m. OK Rust 2021 TESTS 26 15 0
171182523 wrick A Sept. 7, 2022, 1:13 a.m. OK Scala TESTS 26 546 0
171195222 wrick A Sept. 7, 2022, 5:28 a.m. OK Scala TESTS 26 561 0
171193102 wrick A Sept. 7, 2022, 4:54 a.m. OK Scala TESTS 26 561 0
171182197 wrick A Sept. 7, 2022, 1:05 a.m. OK Scala TESTS 26 577 0
171181653 wrick A Sept. 7, 2022, 12:53 a.m. OK Scala TESTS 26 608 0

remove filters

Back to search problems