Atto Round 1 (Codeforces Round 1041, Div. 1 + 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
2127 Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) FINISHED False 10800 21828323 Aug. 7, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 19570 ) A Mix Mex Max PROGRAMMING constructive algorithms greedy math

You are given an array (a) consisting of (n) non-negative integers. However, some elements of (a) are missing, and they are represented by (−1). We define that the array (a) is good if and only if the following holds for every (1 \leq i \leq n-2): () \operatorname{mex}(a_i, a_{i+1}, a_{i+2}) = \max(a_i, a_{i+1}, a_{i+2}) - \min(a_i, a_{i+1}, a_{i+2}), () where (\operatorname{mex}(b)) denotes the minimum excluded (MEX)(^{\text{∗}}) of the integers in (b). You have to determine whether you can make (a) good after replacing each (-1) in (a) with a non-negative integer. (^{\text{∗}})The minimum excluded (MEX) of a collection of integers (b_1, b_2, \ldots, b_k) is defined as the smallest non-negative integer (x) which does not occur in the collection (b). For example, (\operatorname{mex}(2,2,1)=0) because (0) does not belong to the array, and (\operatorname{mex}(0,3,1,2)=4) because (0), (1), (2), and (3) appear in the array, but (4) does not. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 500)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((3 \leq n \leq 100)) — the length of (a). The second line contains (n) integers (a_1,a_2,\ldots,a_n) ((-1 \leq a_i \leq 100)) — the elements of (a). (a_i = -1) denotes that this element is missing. For each test case, output " YES " if it is possible to make (a) good , and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. In the first test case, we can put (a_1 = a_2 = a_3 = 1). Then, (\operatorname{mex}(a_1, a_2, a_3) = \operatorname{mex}(1, 1, 1) = 0); (\max(a_1, a_2, a_3) = \max(1, 1, 1) = 1); $$$\m

Tutorials

Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
332960214 ronakumar786 A Aug. 8, 2025, 6:05 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332960065 destined_person A Aug. 8, 2025, 6:04 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332960015 cuong0812 A Aug. 8, 2025, 6:03 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332959869 Gononajontro_Biggani A Aug. 8, 2025, 6:02 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332959760 FortunerLegender A Aug. 8, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332959212 PranksterComet A Aug. 8, 2025, 5:55 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332957407 Jelly.bean A Aug. 8, 2025, 5:37 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332956986 LieFleks A Aug. 8, 2025, 5:33 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332956913 beans100 A Aug. 8, 2025, 5:32 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332956535 Mortis_Rex A Aug. 8, 2025, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 9 46 0
332959226 ghost_9 A Aug. 8, 2025, 5:55 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332958933 Exceptional_handling18 A Aug. 8, 2025, 5:53 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332958377 Misty7 A Aug. 8, 2025, 5:47 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332957061 nani_444 A Aug. 8, 2025, 5:34 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332956895 hariomkumar2262006 A Aug. 8, 2025, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332956432 keep00 A Aug. 8, 2025, 5:27 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332954416 EncryptShinobi01 A Aug. 8, 2025, 5:03 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332954352 sailealt31 A Aug. 8, 2025, 5:02 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332954287 Pranshu_kedia A Aug. 8, 2025, 5:01 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332953817 sakshamrathi21 A Aug. 8, 2025, 4:56 a.m. OK C++20 (GCC 13-64) TESTS 9 46 0
332932999 A_G A Aug. 7, 2025, 11:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 9 31 0
332960220 ahad021206 A Aug. 8, 2025, 6:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332960079 harmansingla454 A Aug. 8, 2025, 6:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332959594 thsiam360 A Aug. 8, 2025, 5:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332959431 Shourya823 A Aug. 8, 2025, 5:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332958544 genka. A Aug. 8, 2025, 5:49 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332958171 yyyz04 A Aug. 8, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332957724 Mominul_Moon A Aug. 8, 2025, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332957265 auos A Aug. 8, 2025, 5:36 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332957168 aluben_noen A Aug. 8, 2025, 5:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 9 46 0
332956769 __blank__171 A Aug. 8, 2025, 5:30 a.m. OK GNU C11 TESTS 9 46 102400
332901676 klu2300030886 A Aug. 7, 2025, 5:22 p.m. OK GNU C11 TESTS 9 46 102400
332913438 MegaVerkruzo A Aug. 7, 2025, 6:31 p.m. OK Haskell TESTS 9 109 204800
332943896 fatal-98 A Aug. 8, 2025, 2:49 a.m. OK Java 21 TESTS 9 218 307200
332921383 BiggestFish06 A Aug. 7, 2025, 7:37 p.m. OK Java 21 TESTS 10 218 614400
332919713 oberoiansh799 A Aug. 7, 2025, 7:20 p.m. OK Java 21 TESTS 10 218 716800
332942576 Tharun_Reddy_ A Aug. 8, 2025, 2:32 a.m. OK Java 21 TESTS 9 218 819200
332955462 harshilshrma A Aug. 8, 2025, 5:15 a.m. OK Java 21 TESTS 9 233 1024000
332929961 jonathanandres5iv6 A Aug. 7, 2025, 9:53 p.m. OK Java 21 TESTS 9 234 512000
332935628 dznz A Aug. 8, 2025, 12:38 a.m. OK Java 21 TESTS 9 234 716800
332920653 pawansrinivas10 A Aug. 7, 2025, 7:30 p.m. OK Java 21 TESTS 10 249 512000
332954320 sulabhambule02 A Aug. 8, 2025, 5:02 a.m. OK Java 21 TESTS 9 249 614400
332958435 ayush9453 A Aug. 8, 2025, 5:48 a.m. OK Java 21 TESTS 9 264 1433600
332940357 warframe A Aug. 8, 2025, 2:02 a.m. OK Java 8 TESTS 9 155 0
332946614 pratyushbirole A Aug. 8, 2025, 3:24 a.m. OK Java 8 TESTS 9 202 0
332919515 pranav__muj A Aug. 7, 2025, 7:18 p.m. OK Java 8 TESTS 10 202 0
332916794 Kaikondar A Aug. 7, 2025, 6:55 p.m. OK Java 8 TESTS 10 202 0
332919962 povtemp A Aug. 7, 2025, 7:23 p.m. OK Java 8 TESTS 10 234 0
332955388 sadgirpooja20 A Aug. 8, 2025, 5:14 a.m. OK Java 8 TESTS 9 265 102400
332918591 L-S-S A Aug. 7, 2025, 7:10 p.m. OK Kotlin 1.9 TESTS 10 202 1740800
332916396 anasin394 A Aug. 7, 2025, 6:52 p.m. OK Node.js TESTS 10 108 1945600
332953978 tojra A Aug. 8, 2025, 4:58 a.m. OK PyPy 3 TESTS 9 124 2764800
332901764 Tulasiram_V A Aug. 7, 2025, 5:23 p.m. OK PyPy 3 TESTS 9 155 1945600
332955236 nanhi_pari110 A Aug. 8, 2025, 5:13 a.m. OK PyPy 3 TESTS 9 156 4403200
332948243 tooth_pick A Aug. 8, 2025, 3:46 a.m. OK PyPy 3-64 TESTS 9 77 1740800
332932877 Emikooh A Aug. 7, 2025, 11:26 p.m. OK PyPy 3-64 TESTS 9 77 1740800
332927971 Qwerty1412 A Aug. 7, 2025, 9:09 p.m. OK PyPy 3-64 TESTS 9 77 4505600
332914293 0Happy1 A Aug. 7, 2025, 6:36 p.m. OK PyPy 3-64 TESTS 10 78 1945600
332938717 VSS303360_ahmed_nawaz_ A Aug. 8, 2025, 1:35 a.m. OK PyPy 3-64 TESTS 9 92 1638400
332957349 Arya_Abhinav A Aug. 8, 2025, 5:37 a.m. OK PyPy 3-64 TESTS 9 93 1638400
332950738 pebblefish A Aug. 8, 2025, 4:16 a.m. OK PyPy 3-64 TESTS 9 93 1638400
332917896 jvatsal0709 A Aug. 7, 2025, 7:04 p.m. OK PyPy 3-64 TESTS 10 93 1638400
332948146 tooth_pick A Aug. 8, 2025, 3:45 a.m. OK PyPy 3-64 TESTS 9 93 1740800
332920773 SrEy_P-0-7 A Aug. 7, 2025, 7:31 p.m. OK PyPy 3-64 TESTS 10 93 1945600
332959349 Mati_Tanam A Aug. 8, 2025, 5:57 a.m. OK Python 3 TESTS 9 61 204800
332948188 wayneisadog A Aug. 8, 2025, 3:45 a.m. OK Python 3 TESTS 9 61 204800
332954085 dhruvsharma03022 A Aug. 8, 2025, 4:59 a.m. OK Python 3 TESTS 9 62 0
332939629 qos A Aug. 8, 2025, 1:51 a.m. OK Python 3 TESTS 9 62 204800
332926061 aman7kh8an6 A Aug. 7, 2025, 8:36 p.m. OK Python 3 TESTS 9 62 204800
332917440 NSTKrishnagehlot A Aug. 7, 2025, 7 p.m. OK Python 3 TESTS 10 62 204800
332903823 naman_g1234 A Aug. 7, 2025, 5:28 p.m. OK Python 3 TESTS 9 62 204800
332898379 Varad9175 A Aug. 7, 2025, 5:14 p.m. OK Python 3 TESTS 9 62 204800
332930101 MtrinityK A Aug. 7, 2025, 9:57 p.m. OK Python 3 TESTS 9 62 307200
332942384 acaaa_ A Aug. 8, 2025, 2:30 a.m. OK Python 3 TESTS 9 77 204800
332938990 saeidex A Aug. 8, 2025, 1:40 a.m. OK Rust 2021 TESTS 9 46 0
332940430 saeidex A Aug. 8, 2025, 2:03 a.m. OK Rust 2021 TESTS 9 46 102400
332937417 saeidex A Aug. 8, 2025, 1:12 a.m. OK Rust 2021 TESTS 9 61 102400

remove filters

Back to search problems