Codeforces Round 803 (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
1698 Codeforces Round 803 (Div. 2) FINISHED False 8100 80839463 June 28, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18779 ) C 3SUM Closure PROGRAMMING brute force data structures

B'You are given an array a of length n . The array is called 3SUM-closed if for all distinct indices i , j , k , the sum a_i + a_j + a_k is an element of the array. More formally, a is 3SUM-closed if for all integers 1 <= q i < j < k <= q n , there exists some integer 1 <= q l <= q n such that a_i + a_j + a_k = a_l . Determine if a is 3SUM-closed. The first line contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains an integer n ( 3 <= q n <= q 2 cdot 10^5 ) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ... , a_n ( -10^9 <= q a_i <= q 10^9 ) -- the elements of the array. It is guaranteed that the sum of n across all test cases does not exceed 2 cdot 10^5 . For each test case, output "YES" (without quotes) if a is 3SUM-closed 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, there is only one triple where i=1 , j=2 , k=3 . In this case, a_1 + a_2 + a_3 = 0 , which is an element of the array ( a_2 = 0 ), so the array is 3SUM-closed. In the second test case, a_1 + a_4 + a_5 = -1 , which is not an element of the array. Therefore, the array is not 3SUM-closed. In the third test case, a_i + a_j + a_k = 0 for all distinct i , j , k , and 0 is an element of the array, so the array is 3SUM-closed. '...

Tutorials

Codeforces Round #803 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
162195376 ldu-LC C June 29, 2022, 3:46 a.m. OK Clang++20 Diagnostics TESTS 23 982 15360000
162161245 ruban C June 28, 2022, 5:47 p.m. OK Delphi TESTS 19 171 213606400
162160232 rainboy C June 28, 2022, 5:40 p.m. OK GNU C11 TESTS 19 31 0
162171786 koqo C June 28, 2022, 7:27 p.m. OK GNU C11 TESTS 20 31 0
162168810 Ambh C June 28, 2022, 6:50 p.m. OK GNU C11 TESTS 19 46 0
162167942 Ambh C June 28, 2022, 6:42 p.m. OK GNU C11 TESTS 19 46 0
162163770 Reckless_Raccoon C June 28, 2022, 6:05 p.m. OK GNU C++14 TESTS 19 31 102400
162192979 JA2012 C June 29, 2022, 3:04 a.m. OK GNU C++14 TESTS 23 31 3481600
162201010 scau_apr C June 29, 2022, 5:14 a.m. OK GNU C++14 TESTS 23 46 0
162188489 whhsteven C June 29, 2022, 1:45 a.m. OK GNU C++14 TESTS 23 46 0
162154704 _FuYu C June 28, 2022, 4:49 p.m. OK GNU C++14 TESTS 18 46 0
162198110 pretodf C June 29, 2022, 4:30 a.m. OK GNU C++14 TESTS 23 46 102400
162169799 _vaibhavr_ C June 28, 2022, 7:01 p.m. OK GNU C++14 TESTS 20 46 819200
162185614 Figo11 C June 29, 2022, 12:43 a.m. OK GNU C++14 TESTS 23 46 819200
162186179 rhea_adhikari C June 29, 2022, 12:58 a.m. OK GNU C++14 TESTS 23 46 819200
162191206 VIH C June 29, 2022, 2:33 a.m. OK GNU C++14 TESTS 23 46 819200
162190459 kk19212 C June 29, 2022, 2:19 a.m. OK GNU C++17 TESTS 23 31 2662400
162194480 egret C June 29, 2022, 3:31 a.m. OK GNU C++17 TESTS 23 46 0
162178048 sayeem2004 C June 28, 2022, 9:08 p.m. OK GNU C++17 TESTS 20 46 102400
162196636 AL3X-_- C June 29, 2022, 4:06 a.m. OK GNU C++17 TESTS 23 46 819200
162196296 OmarIT C June 29, 2022, 4:01 a.m. OK GNU C++17 TESTS 23 46 819200
162195876 srinivasyeleti C June 29, 2022, 3:54 a.m. OK GNU C++17 TESTS 23 46 819200
162201098 mohammed.monem C June 29, 2022, 5:15 a.m. OK GNU C++17 TESTS 23 46 819200
162198640 sahil_2609 C June 29, 2022, 4:38 a.m. OK GNU C++17 TESTS 23 46 819200
162197848 iwew C June 29, 2022, 4:26 a.m. OK GNU C++17 TESTS 23 46 819200
162203377 pheonix_01 C June 29, 2022, 5:46 a.m. OK GNU C++17 TESTS 23 46 819200
162190795 xiece666 C June 29, 2022, 2:25 a.m. OK GNU C++17 (64) TESTS 23 15 5324800
162174498 camc C June 28, 2022, 8:05 p.m. OK GNU C++17 (64) TESTS 20 31 0
162161454 Chet8n C June 28, 2022, 5:49 p.m. OK GNU C++17 (64) TESTS 19 31 819200
162192440 Haven_ C June 29, 2022, 2:56 a.m. OK GNU C++17 (64) TESTS 23 31 819200
162189728 RetsaZC19 C June 29, 2022, 2:06 a.m. OK GNU C++17 (64) TESTS 23 31 819200
162195751 nagadeepak511 C June 29, 2022, 3:52 a.m. OK GNU C++17 (64) TESTS 23 31 1638400
162194106 zwuis C June 29, 2022, 3:24 a.m. OK GNU C++17 (64) TESTS 23 31 1638400
162193139 wuruzhao C June 29, 2022, 3:07 a.m. OK GNU C++17 (64) TESTS 23 31 1638400
162190784 Win_Handsome C June 29, 2022, 2:25 a.m. OK GNU C++17 (64) TESTS 23 31 1638400
162189226 magnified C June 29, 2022, 1:58 a.m. OK GNU C++17 (64) TESTS 23 31 1638400
162170350 wiss18 C June 28, 2022, 7:08 p.m. OK GNU C++20 (64) TESTS 20 30 819200
162169244 rgnerdplayer C June 28, 2022, 6:55 p.m. OK GNU C++20 (64) TESTS 20 30 1638400
162154522 -ilya- C June 28, 2022, 4:49 p.m. OK GNU C++20 (64) TESTS 18 31 0
162184356 Binhbocnc C June 29, 2022, 12:09 a.m. OK GNU C++20 (64) TESTS 23 31 819200
162182488 tzyt C June 28, 2022, 11:09 p.m. OK GNU C++20 (64) TESTS 22 31 819200
162181124 WCG C June 28, 2022, 10:25 p.m. OK GNU C++20 (64) TESTS 22 31 819200
162193771 jaygaur99 C June 29, 2022, 3:18 a.m. OK GNU C++20 (64) TESTS 23 31 819200
162191076 Ricarpy_ C June 29, 2022, 2:30 a.m. OK GNU C++20 (64) TESTS 23 31 819200
162190669 megumin111 C June 29, 2022, 2:23 a.m. OK GNU C++20 (64) TESTS 23 31 819200
162185480 xdO_o C June 29, 2022, 12:40 a.m. OK GNU C++20 (64) TESTS 23 31 819200
162182636 koqo C June 28, 2022, 11:14 p.m. OK Go TESTS 22 139 4300800
162184215 satyaa_78 C June 29, 2022, 12:05 a.m. OK Java 11 TESTS 23 171 0
162161275 thunderbolt_sid C June 28, 2022, 5:48 p.m. OK Java 11 TESTS 19 186 0
162198125 KarMa_ C June 29, 2022, 4:30 a.m. OK Java 11 TESTS 23 202 0
162198087 _KarMax_ C June 29, 2022, 4:30 a.m. OK Java 11 TESTS 23 202 0
162195030 SkadiTheCorruptHeart C June 29, 2022, 3:40 a.m. OK Java 11 TESTS 23 202 0
162194810 aditya2024 C June 29, 2022, 3:36 a.m. OK Java 11 TESTS 23 202 0
162190413 unfixedbug C June 29, 2022, 2:18 a.m. OK Java 11 TESTS 23 202 0
162163172 yashkorekar23 C June 28, 2022, 6:01 p.m. OK Java 11 TESTS 19 202 0
162169535 Mr.Awesome C June 28, 2022, 6:58 p.m. OK Java 11 TESTS 20 202 4096000
162194034 Longgggggggg C June 29, 2022, 3:23 a.m. OK Java 11 TESTS 23 202 11161600
162194083 zp16630309290 C June 29, 2022, 3:24 a.m. OK Java 17 TESTS 23 701 13312000
162162917 r3hab.rs C June 28, 2022, 5:59 p.m. OK Java 8 TESTS 19 124 1945600
162191265 ikillmyself C June 29, 2022, 2:34 a.m. OK Java 8 TESTS 23 139 0
162197527 sankcan55 C June 29, 2022, 4:21 a.m. OK Java 8 TESTS 23 155 2355200
162197050 tanishq044 C June 29, 2022, 4:13 a.m. OK Java 8 TESTS 23 155 3072000
162172781 Koka C June 28, 2022, 7:41 p.m. OK Java 8 TESTS 20 155 3174400
162172746 handle007 C June 28, 2022, 7:41 p.m. OK Java 8 TESTS 20 155 3174400
162166633 Omar_Mohammad C June 28, 2022, 6:29 p.m. OK Java 8 TESTS 19 155 3174400
162157191 priyaroy3370 C June 28, 2022, 5:23 p.m. OK Java 8 TESTS 18 170 3788800
162201899 aryaman_571 C June 29, 2022, 5:26 a.m. OK Java 8 TESTS 23 171 3072000
162163484 r3hab.rs C June 28, 2022, 6:03 p.m. OK Java 8 TESTS 19 202 13209600
162198329 BruteForcee C June 29, 2022, 4:34 a.m. OK Kotlin 1.4 TESTS 23 171 4403200
162194422 hcp C June 29, 2022, 3:29 a.m. OK MS C++ 2017 TESTS 23 62 2560000
162165028 De_nis C June 28, 2022, 6:15 p.m. OK MS C++ 2017 TESTS 19 156 819200
162160023 andy562.dlg C June 28, 2022, 5:39 p.m. OK MS C++ 2017 TESTS 19 171 2252800
162200138 merzgling C June 29, 2022, 5:01 a.m. OK MS C++ 2017 TESTS 23 171 2764800
162158314 Tor_250 C June 28, 2022, 5:29 p.m. OK MS C++ 2017 TESTS 19 171 3276800
162159239 AlexeyT C June 28, 2022, 5:34 p.m. OK MS C++ 2017 TESTS 19 187 0
162158636 Bossusuprem C June 28, 2022, 5:31 p.m. OK MS C++ 2017 TESTS 19 187 0
162167364 OptimuS99 C June 28, 2022, 6:36 p.m. OK MS C++ 2017 TESTS 19 187 1638400
162182374 purpleAce C June 28, 2022, 11:04 p.m. OK MS C++ 2017 TESTS 22 218 7782400
162168387 fatant C June 28, 2022, 6:46 p.m. OK MS C++ 2017 TESTS 19 234 8089600
162159220 hash1023 C June 28, 2022, 5:34 p.m. OK PyPy 3 TESTS 19 155 18739200
162171037 pavanfknkarthik C June 28, 2022, 7:18 p.m. OK PyPy 3 TESTS 20 187 19456000
162164032 pranay_28 C June 28, 2022, 6:08 p.m. OK PyPy 3 TESTS 19 233 17203200
162200949 Bishwanath C June 29, 2022, 5:13 a.m. OK PyPy 3 TESTS 23 249 14540800
162190113 Zhuchokk C June 29, 2022, 2:13 a.m. OK PyPy 3 TESTS 23 249 14540800
162188371 M.MUEED.AWAIS C June 29, 2022, 1:43 a.m. OK PyPy 3 TESTS 23 249 18739200
162187308 Muhammad.Daniyal C June 29, 2022, 1:24 a.m. OK PyPy 3 TESTS 23 249 18739200
162161661 hxu10 C June 28, 2022, 5:50 p.m. OK PyPy 3 TESTS 19 249 28876800
162164351 namans777 C June 28, 2022, 6:10 p.m. OK PyPy 3 TESTS 19 265 14540800
162157850 MyWaifuSatouMatsuzaka C June 28, 2022, 5:27 p.m. OK PyPy 3-64 TESTS 19 139 12185600
162159875 _Frust C June 28, 2022, 5:38 p.m. OK PyPy 3-64 TESTS 19 139 13824000
162166709 ronitsingh C June 28, 2022, 6:30 p.m. OK PyPy 3-64 TESTS 19 140 12390400
162163452 hkwu6013 C June 28, 2022, 6:03 p.m. OK PyPy 3-64 TESTS 19 155 17715200
162192560 Turtleeee C June 29, 2022, 2:58 a.m. OK PyPy 3-64 TESTS 23 155 18227200
162166177 sarthak2308 C June 28, 2022, 6:25 p.m. OK PyPy 3-64 TESTS 19 155 19046400
162160636 Petroleumus C June 28, 2022, 5:43 p.m. OK PyPy 3-64 TESTS 19 156 16793600
162161315 gesuta C June 28, 2022, 5:48 p.m. OK PyPy 3-64 TESTS 19 156 19046400
162156820 ronitsingh C June 28, 2022, 5:21 p.m. OK PyPy 3-64 TESTS 18 170 18124800
162161061 gesuta C June 28, 2022, 5:46 p.m. OK PyPy 3-64 TESTS 19 170 19251200
162176410 dima98657 C June 28, 2022, 8:37 p.m. OK Python 3 TESTS 20 78 13926400
162182284 zubra.bubra C June 28, 2022, 11:01 p.m. OK Python 3 TESTS 22 93 13004800
162169381 RedSpica C June 28, 2022, 6:57 p.m. OK Python 3 TESTS 20 93 13004800
162167708 elistark C June 28, 2022, 6:39 p.m. OK Python 3 TESTS 19 93 14028800
162160497 aditya3369 C June 28, 2022, 5:42 p.m. OK Python 3 TESTS 19 93 14028800
162168460 eugalt C June 28, 2022, 6:47 p.m. OK Python 3 TESTS 19 93 14643200
162172612 eugalt C June 28, 2022, 7:39 p.m. OK Python 3 TESTS 20 93 14745600
162170117 eugalt C June 28, 2022, 7:05 p.m. OK Python 3 TESTS 20 93 14745600
162164817 namans777 C June 28, 2022, 6:14 p.m. OK Python 3 TESTS 19 108 13107200
162179087 eugalt C June 28, 2022, 9:31 p.m. OK Python 3 TESTS 21 108 14643200
162158959 kokkuri C June 28, 2022, 5:33 p.m. OK Ruby 3 TESTS 19 389 13721600
162171337 Hyrulia C June 28, 2022, 7:22 p.m. OK Rust 2021 TESTS 20 31 5120000
162172980 Akash_123 C June 28, 2022, 7:44 p.m. OK Rust 2021 TESTS 20 31 6246400

remove filters

Back to search problems