Codeforces Round 822 (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
1734 Codeforces Round 822 (Div. 2) FINISHED False 7200 73331663 Sept. 23, 2022, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21390 ) A Select Three Sticks PROGRAMMING greedy math sortings

B'You are given n sticks with positive integral length a_1, a_2, ldots, a_n . You can perform the following operation any number of times (possibly zero): What is the minimum number of operations that you have to perform such that it is possible to select three of the n sticks and use them without breaking to form an equilateral triangle? An equilateral triangle is a triangle where all of its three sides have the same length. The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- 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 <= 300 ) -- the number of sticks. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the lengths of the sticks. It is guaranteed that the sum of n over all test cases does not exceed 300 . For each test case, print one integer on a single line -- the minimum number of operations to be made. In the first test case, you can increase the length of the first stick by 1 , then decrease the length of the third stick by 1 . In total, you perform 2 operations, such that the three sticks form an equilateral triangle of side length 2 . In the fourth test case, you can decrease the length of the seventh stick by 1 . An equilateral triangle of side length 1 can be selected and formed by the second, fourth, and seventh sticks. '...

Tutorials

Codeforces Round #822 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
173237177 Ovidijus_Tocelis A Sept. 23, 2022, 4:06 p.m. OK C# 10 TESTS 13 77 204800
173261644 singhkrishnajsr143 A Sept. 24, 2022, 2:43 a.m. OK C# 10 TESTS 13 109 102400
173233964 SD8 A Sept. 23, 2022, 3:38 p.m. OK C# 8 TESTS 13 77 102400
173262975 Constellation_ A Sept. 24, 2022, 3:07 a.m. OK Clang++17 Diagnostics TESTS 13 31 102400
173270339 thechaudhary_anirudh A Sept. 24, 2022, 4:56 a.m. OK Clang++17 Diagnostics TESTS 13 46 0
173235484 saikumar31608 A Sept. 23, 2022, 3:50 p.m. OK Clang++20 Diagnostics TESTS 13 31 3174400
173236966 klu_2000030951 A Sept. 23, 2022, 4:04 p.m. OK Clang++20 Diagnostics TESTS 13 31 3174400
173239753 sanjay77 A Sept. 23, 2022, 4:31 p.m. OK GNU C11 TESTS 13 15 0
173269174 Anik20CSE030 A Sept. 24, 2022, 4:39 a.m. OK GNU C11 TESTS 13 15 0
173271812 SP2003 A Sept. 24, 2022, 5:15 a.m. OK GNU C11 TESTS 13 15 0
173225935 Adiat A Sept. 23, 2022, 2:42 p.m. OK GNU C11 TESTS 13 15 0
173231420 HMRahman A Sept. 23, 2022, 3:18 p.m. OK GNU C11 TESTS 13 15 0
173227662 kingerror A Sept. 23, 2022, 2:51 p.m. OK GNU C11 TESTS 13 15 819200
173267669 372511387 A Sept. 24, 2022, 4:18 a.m. OK GNU C++14 TESTS 13 0 0
173264944 ritikagr061 A Sept. 24, 2022, 3:33 a.m. OK GNU C++14 TESTS 13 0 0
173263506 OTK_Shadi A Sept. 24, 2022, 3:15 a.m. OK GNU C++14 TESTS 13 0 0
173261277 cook451 A Sept. 24, 2022, 2:37 a.m. OK GNU C++14 TESTS 13 0 0
173269340 haimo A Sept. 24, 2022, 4:42 a.m. OK GNU C++14 TESTS 13 0 0
173275862 alkido A Sept. 24, 2022, 5:57 a.m. OK GNU C++14 TESTS 13 0 0
173273472 Aleph-zero A Sept. 24, 2022, 5:33 a.m. OK GNU C++14 TESTS 13 0 0
173275133 bkifhr9 A Sept. 24, 2022, 5:51 a.m. OK GNU C++14 TESTS 13 0 0
173272892 Rainandbow A Sept. 24, 2022, 5:27 a.m. OK GNU C++14 TESTS 13 0 0
173270400 _zjb A Sept. 24, 2022, 4:57 a.m. OK GNU C++14 TESTS 13 0 0
173272077 rrr333 A Sept. 24, 2022, 5:18 a.m. OK GNU C++17 TESTS 13 0 0
173271827 P1g A Sept. 24, 2022, 5:15 a.m. OK GNU C++17 TESTS 13 0 0
173271762 SCMZUoj A Sept. 24, 2022, 5:14 a.m. OK GNU C++17 TESTS 13 0 0
173269707 payalvala1923 A Sept. 24, 2022, 4:47 a.m. OK GNU C++17 TESTS 13 0 0
173274548 sapna_05 A Sept. 24, 2022, 5:45 a.m. OK GNU C++17 TESTS 13 0 0
173274026 Hussam-alwan A Sept. 24, 2022, 5:40 a.m. OK GNU C++17 TESTS 13 0 0
173273984 rasika_g16 A Sept. 24, 2022, 5:39 a.m. OK GNU C++17 TESTS 13 0 0
173273625 ahmedsaif10 A Sept. 24, 2022, 5:35 a.m. OK GNU C++17 TESTS 13 0 0
173272846 SurajSP A Sept. 24, 2022, 5:27 a.m. OK GNU C++17 TESTS 13 0 0
173272645 B.Shahrom A Sept. 24, 2022, 5:24 a.m. OK GNU C++17 TESTS 13 0 0
173254898 chotaneem A Sept. 23, 2022, 7:12 p.m. OK GNU C++17 (64) TESTS 13 0 0
173266419 Fan_zf A Sept. 24, 2022, 3:58 a.m. OK GNU C++17 (64) TESTS 13 0 0
173264888 OTTFF A Sept. 24, 2022, 3:32 a.m. OK GNU C++17 (64) TESTS 13 0 0
173263204 SaadOoN A Sept. 24, 2022, 3:10 a.m. OK GNU C++17 (64) TESTS 13 0 0
173260344 gustavoakx A Sept. 24, 2022, 1:24 a.m. OK GNU C++17 (64) TESTS 13 0 0
173254969 Khaled93 A Sept. 23, 2022, 7:13 p.m. OK GNU C++17 (64) TESTS 13 0 0
173248133 Jon_Snow1109 A Sept. 23, 2022, 5:57 p.m. OK GNU C++17 (64) TESTS 13 0 0
173244129 I_Am_Back. A Sept. 23, 2022, 5:13 p.m. OK GNU C++17 (64) TESTS 13 0 0
173243874 Haven_ A Sept. 23, 2022, 5:10 p.m. OK GNU C++17 (64) TESTS 13 0 0
173236795 alif_cse_ju A Sept. 23, 2022, 4:02 p.m. OK GNU C++17 (64) TESTS 13 0 0
173271441 Saurav_Kumar A Sept. 24, 2022, 5:11 a.m. OK GNU C++20 (64) TESTS 13 0 0
173271320 TecV A Sept. 24, 2022, 5:10 a.m. OK GNU C++20 (64) TESTS 13 0 0
173271136 RRyan787 A Sept. 24, 2022, 5:07 a.m. OK GNU C++20 (64) TESTS 13 0 0
173270783 FoolestBoy A Sept. 24, 2022, 5:03 a.m. OK GNU C++20 (64) TESTS 13 0 0
173271684 verssy A Sept. 24, 2022, 5:13 a.m. OK GNU C++20 (64) TESTS 13 0 0
173271758 Harek A Sept. 24, 2022, 5:14 a.m. OK GNU C++20 (64) TESTS 13 0 0
173272514 xiaoxing666 A Sept. 24, 2022, 5:23 a.m. OK GNU C++20 (64) TESTS 13 0 0
173274031 mimat_coder A Sept. 24, 2022, 5:40 a.m. OK GNU C++20 (64) TESTS 13 0 0
173275007 pankajrana0112 A Sept. 24, 2022, 5:49 a.m. OK GNU C++20 (64) TESTS 13 0 0
173276349 aalsalyed70 A Sept. 24, 2022, 6:02 a.m. OK GNU C++20 (64) TESTS 13 0 0
173230790 mivael A Sept. 23, 2022, 3:13 p.m. OK Haskell TESTS 13 31 0
173253227 shahvraj1500 A Sept. 23, 2022, 6:51 p.m. OK Java 11 TESTS 13 155 0
173267302 charan2628 A Sept. 24, 2022, 4:12 a.m. OK Java 11 TESTS 13 171 0
173265513 Yousef_Badr A Sept. 24, 2022, 3:43 a.m. OK Java 11 TESTS 13 171 0
173243411 codingbbq A Sept. 23, 2022, 5:05 p.m. OK Java 11 TESTS 13 171 0
173232803 vijender_8601 A Sept. 23, 2022, 3:29 p.m. OK Java 11 TESTS 13 171 0
173227275 g_square A Sept. 23, 2022, 2:49 p.m. OK Java 11 TESTS 13 171 0
173224720 kartik__sethi A Sept. 23, 2022, 2:38 p.m. OK Java 11 TESTS 13 171 0
173231140 vishalmachchha1310 A Sept. 23, 2022, 3:16 p.m. OK Java 11 TESTS 13 186 0
173263225 SpookyJumpyBeans A Sept. 24, 2022, 3:11 a.m. OK Java 11 TESTS 13 187 0
173254522 yahiamoussadek1 A Sept. 23, 2022, 7:07 p.m. OK Java 11 TESTS 13 187 0
173225157 Pratham2908 A Sept. 23, 2022, 2:39 p.m. OK Java 17 TESTS 13 187 0
173256974 CrinklyGolem A Sept. 23, 2022, 7:39 p.m. OK Java 17 TESTS 13 202 307200
173242784 tony4875 A Sept. 23, 2022, 4:59 p.m. OK Java 17 TESTS 13 202 307200
173275344 dongmozsysllb A Sept. 24, 2022, 5:53 a.m. OK Java 17 TESTS 13 202 819200
173216207 NS_69b A Sept. 23, 2022, 1:49 p.m. OK Java 17 TESTS 13 218 512000
173231873 Niket_Pandey A Sept. 23, 2022, 3:22 p.m. OK Java 17 TESTS 13 218 716800
173235764 vivi2006 A Sept. 23, 2022, 3:53 p.m. OK Java 17 TESTS 13 233 307200
173273733 swift51385 A Sept. 24, 2022, 5:36 a.m. OK Java 17 TESTS 13 233 512000
173262061 bishtpiyush17 A Sept. 24, 2022, 2:51 a.m. OK Java 17 TESTS 13 233 512000
173267411 eslamms A Sept. 24, 2022, 4:14 a.m. OK Java 17 TESTS 13 233 921600
173270223 ketangupta12 A Sept. 24, 2022, 4:55 a.m. OK Java 8 TESTS 13 93 0
173255281 Diaa12360 A Sept. 23, 2022, 7:17 p.m. OK Java 8 TESTS 13 93 0
173247217 maneeshnarayan1 A Sept. 23, 2022, 5:47 p.m. OK Java 8 TESTS 13 93 0
173245657 p_310598 A Sept. 23, 2022, 5:30 p.m. OK Java 8 TESTS 13 93 0
173243643 Unrated_Pritam A Sept. 23, 2022, 5:07 p.m. OK Java 8 TESTS 13 93 0
173235952 depurador_ik A Sept. 23, 2022, 3:54 p.m. OK Java 8 TESTS 13 93 0
173234861 Mohamed308 A Sept. 23, 2022, 3:45 p.m. OK Java 8 TESTS 13 93 0
173226429 ankit_0207 A Sept. 23, 2022, 2:44 p.m. OK Java 8 TESTS 13 93 0
173258705 Ibrahimovic_The_Lion A Sept. 23, 2022, 8:06 p.m. OK Java 8 TESTS 13 108 0
173226126 Mohamed_A7med A Sept. 23, 2022, 2:43 p.m. OK Java 8 TESTS 13 108 0
173239393 Krantzy A Sept. 23, 2022, 4:27 p.m. OK Kotlin 1.6 TESTS 13 202 0
173274094 sky_walkery A Sept. 24, 2022, 5:40 a.m. OK Kotlin 1.6 TESTS 13 248 0
173267606 SteppeNomad A Sept. 24, 2022, 4:17 a.m. OK MS C++ 2017 TESTS 13 0 0
173228336 Asadashino1 A Sept. 23, 2022, 2:56 p.m. OK MS C++ 2017 TESTS 13 0 0
173272875 gabalawy A Sept. 24, 2022, 5:27 a.m. OK MS C++ 2017 TESTS 13 15 0
173256996 laquendi A Sept. 23, 2022, 7:39 p.m. OK MS C++ 2017 TESTS 13 15 0
173256882 cptahahab A Sept. 23, 2022, 7:38 p.m. OK MS C++ 2017 TESTS 13 15 0
173242127 hot_chert A Sept. 23, 2022, 4:52 p.m. OK MS C++ 2017 TESTS 13 15 0
173234886 lyy3605 A Sept. 23, 2022, 3:45 p.m. OK MS C++ 2017 TESTS 13 15 0
173230498 wanglujing A Sept. 23, 2022, 3:11 p.m. OK MS C++ 2017 TESTS 13 15 0
173229939 Abdullah_Mahmoud A Sept. 23, 2022, 3:07 p.m. OK MS C++ 2017 TESTS 13 15 0
173227164 Ahmedmadbouly186 A Sept. 23, 2022, 2:48 p.m. OK MS C++ 2017 TESTS 13 15 0
173226692 1_2_3_4_5_9 A Sept. 23, 2022, 2:46 p.m. OK PyPy 2 TESTS 13 327 41779200
173251324 f20210555 A Sept. 23, 2022, 6:30 p.m. OK PyPy 3 TESTS 13 77 0
173238073 sagarpm18 A Sept. 23, 2022, 4:14 p.m. OK PyPy 3 TESTS 13 77 0
173217776 hiardik45_exe A Sept. 23, 2022, 1:54 p.m. OK PyPy 3 TESTS 13 77 0
173262665 MikoTohashu A Sept. 24, 2022, 3:02 a.m. OK PyPy 3 TESTS 13 93 0
173258312 34z12000 A Sept. 23, 2022, 7:59 p.m. OK PyPy 3 TESTS 13 93 0
173247319 edward0414 A Sept. 23, 2022, 5:48 p.m. OK PyPy 3 TESTS 13 93 409600
173269326 fathorse A Sept. 24, 2022, 4:41 a.m. OK PyPy 3 TESTS 13 93 1843200
173230334 Multibala A Sept. 23, 2022, 3:09 p.m. OK PyPy 3 TESTS 13 186 4915200
173225776 Feet_McYeet A Sept. 23, 2022, 2:41 p.m. OK PyPy 3 TESTS 13 202 0
173242005 hash1023 A Sept. 23, 2022, 4:51 p.m. OK PyPy 3 TESTS 13 249 6860800
173259884 magnuseifr A Sept. 23, 2022, 8:25 p.m. OK PyPy 3-64 TESTS 13 46 0
173255594 mrdhnv A Sept. 23, 2022, 7:21 p.m. OK PyPy 3-64 TESTS 13 46 0
173243888 NeelDasgupta A Sept. 23, 2022, 5:10 p.m. OK PyPy 3-64 TESTS 13 46 0
173229071 amonikag A Sept. 23, 2022, 3 p.m. OK PyPy 3-64 TESTS 13 46 0
173228766 aadi_2 A Sept. 23, 2022, 2:58 p.m. OK PyPy 3-64 TESTS 13 46 0
173268877 PlatJack28 A Sept. 24, 2022, 4:35 a.m. OK PyPy 3-64 TESTS 13 61 0
173247423 Endu A Sept. 23, 2022, 5:49 p.m. OK PyPy 3-64 TESTS 13 61 0
173246057 jasmineheart A Sept. 23, 2022, 5:35 p.m. OK PyPy 3-64 TESTS 13 61 0
173233308 segfault11 A Sept. 23, 2022, 3:33 p.m. OK PyPy 3-64 TESTS 13 61 0
173226531 crapcode A Sept. 23, 2022, 2:45 p.m. OK PyPy 3-64 TESTS 13 61 0
173242678 OLOGY A Sept. 23, 2022, 4:58 p.m. OK Python 2 TESTS 13 31 0
173242560 OLOGY A Sept. 23, 2022, 4:57 p.m. OK Python 2 TESTS 13 31 0
173251628 bronze_coder A Sept. 23, 2022, 6:33 p.m. OK Python 3 TESTS 13 31 0
173239893 Priyansh_23May A Sept. 23, 2022, 4:32 p.m. OK Python 3 TESTS 13 31 0
173231431 GoldenHawk A Sept. 23, 2022, 3:19 p.m. OK Python 3 TESTS 13 31 0
173229366 odinluca A Sept. 23, 2022, 3:03 p.m. OK Python 3 TESTS 13 31 0
173268490 yergeldi A Sept. 24, 2022, 4:30 a.m. OK Python 3 TESTS 13 46 0
173268281 gokulraaj59 A Sept. 24, 2022, 4:27 a.m. OK Python 3 TESTS 13 46 0
173258249 mannaemam A Sept. 23, 2022, 7:58 p.m. OK Python 3 TESTS 13 46 0
173258047 souvik03 A Sept. 23, 2022, 7:55 p.m. OK Python 3 TESTS 13 46 0
173252099 ritesh_43 A Sept. 23, 2022, 6:38 p.m. OK Python 3 TESTS 13 46 0
173249454 khonshu_99 A Sept. 23, 2022, 6:11 p.m. OK Python 3 TESTS 13 46 0
173247122 kobae964 A Sept. 23, 2022, 5:46 p.m. OK Rust 2021 TESTS 13 31 0

remove filters

Back to search problems