Codeforces Round 784 (Div. 4)

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
1669 Codeforces Round 784 (Div. 4) FINISHED False 7200 81271499 April 21, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 35166 ) C Odd/Even Increments PROGRAMMING greedy greedy implementation math 800

B'Given an array a=[a_1,a_2, ... ,a_n] of n positive integers, you can do operations of two types on it: Determine if after any number of operations it is possible to make the final array contain only even numbers or only odd numbers. In other words, determine if you can make all elements of the array have the same parity after any number of operations. Note that you can do operations of both types any number of times (even none). Operations of different types can be performed a different number of times. The first line contains an integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains an integer n ( 2 <= q n <= q 50 ) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q 10^3 ) -- the elements of the array. Note that after the performed operations the elements in the array can become greater than 10^3 . Output t lines, each of which contains the answer to the corresponding test case. As an answer, output "YES" if after any number of operations it is possible to make the final array contain only even numbers or only odd numbers, and "NO" otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer). For the first test case, we can increment the elements with an even index, obtaining the array [1, 3, 1] , which contains only odd numbers, so the answer is "YES". For the second test case, we can show that after performing any number of operations we won 't be able to make all elements have the same parity, so the answer is "NO". For the third test case, all elements already have the same parity so the answer is "YES". For the fourth test case, we can perform one operation and increase all elements at odd positions by 1 , thus obtaining the array [1001, 1, 1001, 1, 1001] , and all elemen'...

Tutorials

102101

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154821658 bkifhr9 C April 24, 2022, 7:34 a.m. OK Clang++17 Diagnostics TESTS 4 31 0 800
154823942 vjudge4 C April 24, 2022, 7:59 a.m. OK Clang++17 Diagnostics TESTS 4 31 0 800
154847676 newbie_314 C April 24, 2022, 12:05 p.m. OK Clang++17 Diagnostics TESTS 4 46 0 800
154820099 vjudge3 C April 24, 2022, 7:17 a.m. OK Clang++17 Diagnostics TESTS 4 46 0 800
154775654 Denor C April 23, 2022, 5:45 p.m. OK Delphi TESTS 4 15 102400 800
154780996 vai_125 C April 23, 2022, 6:45 p.m. OK GNU C11 TESTS 4 0 0 800
154823320 dhruv_241102 C April 24, 2022, 7:52 a.m. OK GNU C11 TESTS 4 15 0 800
154823959 vjudge2 C April 24, 2022, 7:59 a.m. OK GNU C11 TESTS 4 15 0 800
154874683 Sarwar82 C April 24, 2022, 4:38 p.m. OK GNU C11 TESTS 4 15 0 800
154866762 predawn C April 24, 2022, 3:16 p.m. OK GNU C11 TESTS 4 15 0 800
154654766 pujitha_05 C April 23, 2022, 12:16 p.m. OK GNU C11 TESTS 4 15 0 800
154877685 Kukiii C April 24, 2022, 5:24 p.m. OK GNU C11 TESTS 4 15 0 800
154891916 TesNik008 C April 24, 2022, 9:36 p.m. OK GNU C11 TESTS 4 15 0 800
154710289 GTrigger C April 23, 2022, 2:23 p.m. OK GNU C11 TESTS 4 15 0 800
154819963 TGH_yang_xiao C April 24, 2022, 7:17 a.m. OK GNU C11 TESTS 4 15 0 800
154866100 Nine_Nine C April 24, 2022, 3:09 p.m. OK GNU C++14 TESTS 4 0 0 800
154861646 farjana_dipa C April 24, 2022, 2:20 p.m. OK GNU C++14 TESTS 4 0 0 800
154861087 Duck_sajin C April 24, 2022, 2:14 p.m. OK GNU C++14 TESTS 4 0 0 800
154859647 dyna-26 C April 24, 2022, 1:59 p.m. OK GNU C++14 TESTS 4 0 0 800
154854316 iniesta_barcelona C April 24, 2022, 1:07 p.m. OK GNU C++14 TESTS 4 0 0 800
154854226 tt2311 C April 24, 2022, 1:07 p.m. OK GNU C++14 TESTS 4 0 0 800
154847668 sr_2 C April 24, 2022, 12:05 p.m. OK GNU C++14 TESTS 4 0 0 800
154899239 CBZorz C April 25, 2022, 2:59 a.m. OK GNU C++14 TESTS 4 0 0 800
154878238 Professor20 C April 24, 2022, 5:32 p.m. OK GNU C++14 TESTS 4 0 0 800
154875199 confidencemen C April 24, 2022, 4:47 p.m. OK GNU C++14 TESTS 4 0 0 800
154881562 prakhar_glitch C April 24, 2022, 6:23 p.m. OK GNU C++17 TESTS 4 0 0 800
154893313 morasha3 C April 24, 2022, 10:06 p.m. OK GNU C++17 TESTS 4 0 0 800
154903791 prash_ant C April 25, 2022, 4:43 a.m. OK GNU C++17 TESTS 4 0 0 800
154906294 Shivangee107 C April 25, 2022, 5:34 a.m. OK GNU C++17 TESTS 4 0 0 800
154906538 Aniketan.Gaurav C April 25, 2022, 5:39 a.m. OK GNU C++17 TESTS 4 0 0 800
154907151 _Ifty_ C April 25, 2022, 5:51 a.m. OK GNU C++17 TESTS 4 0 0 800
154907158 Hem_Bhalodiya C April 25, 2022, 5:52 a.m. OK GNU C++17 TESTS 4 0 0 800
154888379 braman C April 24, 2022, 8:27 p.m. OK GNU C++17 TESTS 4 0 0 800
154886335 Pranay_Kumar1801 C April 24, 2022, 7:49 p.m. OK GNU C++17 TESTS 4 0 0 800
154882783 Noor-MoMani C April 24, 2022, 6:43 p.m. OK GNU C++17 TESTS 4 0 0 800
154866044 Meet002 C April 24, 2022, 3:08 p.m. OK GNU C++17 (64) TESTS 4 0 0 800
154902055 Peal_Mazumder C April 25, 2022, 4:02 a.m. OK GNU C++17 (64) TESTS 4 0 0 800
154899357 TLE. C April 25, 2022, 3:02 a.m. OK GNU C++17 (64) TESTS 4 0 0 800
154886392 HydrO7gen C April 24, 2022, 7:50 p.m. OK GNU C++17 (64) TESTS 4 0 0 800
154862808 Steins__Gate C April 24, 2022, 2:32 p.m. OK GNU C++17 (64) TESTS 4 0 0 800
154852921 shekabhi1208 C April 24, 2022, 12:54 p.m. OK GNU C++17 (64) TESTS 4 0 0 800
154835474 cigarInsteadGof C April 24, 2022, 10:06 a.m. OK GNU C++17 (64) TESTS 4 0 0 800
154834737 Heisenberg222 C April 24, 2022, 9:57 a.m. OK GNU C++17 (64) TESTS 4 0 0 800
154830560 IANYEYZ C April 24, 2022, 9:09 a.m. OK GNU C++17 (64) TESTS 4 0 0 800
154823736 Ash_Dr C April 24, 2022, 7:57 a.m. OK GNU C++17 (64) TESTS 4 0 0 800
154862433 quanghuy.tb C April 24, 2022, 2:28 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154869734 m_iqf C April 24, 2022, 3:46 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154871050 -pandey_shivam- C April 24, 2022, 3:57 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154872105 FumbleHead C April 24, 2022, 4:06 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154872164 gfhfbg C April 24, 2022, 4:07 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154874201 P11011 C April 24, 2022, 4:31 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154876278 KiaraTeAmo C April 24, 2022, 5:04 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154889358 omran567 C April 24, 2022, 8:45 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154890621 nik.danilov C April 24, 2022, 9:09 p.m. OK GNU C++20 (64) TESTS 4 0 0 800
154905229 OptimalKnight C April 25, 2022, 5:12 a.m. OK GNU C++20 (64) TESTS 4 0 0 800
154875469 pepradere C April 24, 2022, 4:51 p.m. OK Go TESTS 4 15 102400 800
154617453 vjudge2 C April 23, 2022, 5:04 a.m. OK Go TESTS 4 77 204800 800
154637869 LanceTheDragonTrainer C April 23, 2022, 9:08 a.m. OK Java 11 TESTS 4 140 0 800
154648034 Kubernetes C April 23, 2022, 10:59 a.m. OK Java 11 TESTS 4 140 0 800
154637182 iamsoumik C April 23, 2022, 9:01 a.m. OK Java 11 TESTS 4 155 0 800
154875695 muppetlol C April 24, 2022, 4:55 p.m. OK Java 11 TESTS 4 155 0 800
154837505 rumpelstilzchen C April 24, 2022, 10:32 a.m. OK Java 11 TESTS 4 155 0 800
154623314 sf14t C April 23, 2022, 6:21 a.m. OK Java 11 TESTS 4 155 0 800
154506142 dhruvil8804 C April 22, 2022, 2:08 p.m. OK Java 11 TESTS 4 155 0 800
154494569 vijender_8601 C April 22, 2022, 12:09 p.m. OK Java 11 TESTS 4 155 0 800
154538531 its_aks_ulure C April 22, 2022, 3:12 p.m. OK Java 11 TESTS 4 156 0 800
154498690 rorito_199 C April 22, 2022, 12:50 p.m. OK Java 11 TESTS 4 156 0 800
154614002 prakhar_30 C April 23, 2022, 3:59 a.m. OK Java 8 TESTS 4 77 0 800
154648459 Hivilsm C April 23, 2022, 11:04 a.m. OK Java 8 TESTS 4 93 0 800
154497714 ashmit_35 C April 22, 2022, 12:40 p.m. OK Java 8 TESTS 4 108 0 800
154647790 vikaspanwar11 C April 23, 2022, 10:56 a.m. OK Java 8 TESTS 4 108 0 800
154627772 parth3743 C April 23, 2022, 7:09 a.m. OK Java 8 TESTS 4 108 0 800
154661599 AbdelrahmanFathy C April 23, 2022, 12:42 p.m. OK Java 8 TESTS 4 108 37785600 800
154493589 laila0 C April 22, 2022, 11:59 a.m. OK Java 8 TESTS 4 109 0 800
154645816 ak_ankit C April 23, 2022, 10:34 a.m. OK Java 8 TESTS 4 109 0 800
154591363 ayushsinghs347 C April 22, 2022, 7:19 p.m. OK Java 8 TESTS 4 109 0 800
154874228 nandini_1999 C April 24, 2022, 4:31 p.m. OK Java 8 TESTS 4 124 0 800
154609066 ryanberg C April 23, 2022, 2:05 a.m. OK Kotlin 1.5 TESTS 4 155 0 800
154871306 wbars C April 24, 2022, 3:59 p.m. OK Kotlin 1.5 TESTS 4 218 0 800
154809082 pandoomanda C April 24, 2022, 5 a.m. OK Kotlin 1.6 TESTS 4 186 0 800
154641823 ryuflower C April 23, 2022, 9:49 a.m. OK Kotlin 1.6 TESTS 4 187 0 800
154496138 hoxym01a C April 22, 2022, 12:26 p.m. OK Kotlin 1.6 TESTS 4 202 0 800
154494548 paparwinthai C April 22, 2022, 12:09 p.m. OK Kotlin 1.6 TESTS 4 202 819200 800
154586070 kvcodereaper C April 22, 2022, 6:05 p.m. OK MS C++ 2017 TESTS 4 0 0 800
154829451 bkifhr7 C April 24, 2022, 8:57 a.m. OK MS C++ 2017 TESTS 4 0 0 800
154625569 bkifhr9 C April 23, 2022, 6:45 a.m. OK MS C++ 2017 TESTS 4 0 0 800
154588967 ShardaKriti1 C April 22, 2022, 6:42 p.m. OK MS C++ 2017 TESTS 4 0 0 800
154499162 ferimasv C April 22, 2022, 12:55 p.m. OK MS C++ 2017 TESTS 4 0 0 800
154629659 Mr_Simple_TG C April 23, 2022, 7:31 a.m. OK MS C++ 2017 TESTS 4 15 0 800
154829250 bkifhr10 C April 24, 2022, 8:55 a.m. OK MS C++ 2017 TESTS 4 15 0 800
154800225 LLLLLJR C April 24, 2022, 1:44 a.m. OK MS C++ 2017 TESTS 4 15 0 800
154787251 theinvasian C April 23, 2022, 8:21 p.m. OK MS C++ 2017 TESTS 4 15 0 800
154619854 vjudge3 C April 23, 2022, 5:39 a.m. OK MS C++ 2017 TESTS 4 15 0 800
154647140 edge555 C April 23, 2022, 10:49 a.m. OK .NET Core C# TESTS 4 77 409600 800
154596278 calcp262144 C April 22, 2022, 8:35 p.m. OK Node.js TESTS 4 46 1638400 800
154787920 acorn11 C April 23, 2022, 8:31 p.m. OK PyPy 2 TESTS 4 46 204800 800
154833836 Aya_Elwakil C April 24, 2022, 9:47 a.m. OK PyPy 3 TESTS 4 77 1331200 800
154618392 akifpathan C April 23, 2022, 5:18 a.m. OK PyPy 3 TESTS 4 77 1433600 800
154892863 eosboss C April 24, 2022, 9:56 p.m. OK PyPy 3 TESTS 4 77 1536000 800
154885042 amisha26 C April 24, 2022, 7:24 p.m. OK PyPy 3 TESTS 4 77 1945600 800
154565985 FilipFilipinski C April 22, 2022, 4:08 p.m. OK PyPy 3 TESTS 4 77 2048000 800
154627804 seraph14 C April 23, 2022, 7:09 a.m. OK PyPy 3 TESTS 4 93 1536000 800
154696093 osama_a_rehman C April 23, 2022, 2:08 p.m. OK PyPy 3 TESTS 4 124 2457600 800
154592441 turkoarias C April 22, 2022, 7:36 p.m. OK PyPy 3-64 TESTS 4 46 2150400 800
154588029 Kostya_Heshur C April 22, 2022, 6:29 p.m. OK PyPy 3-64 TESTS 4 46 2150400 800
154503706 aman404found C April 22, 2022, 1:43 p.m. OK PyPy 3-64 TESTS 4 46 2150400 800
154502343 tushar26427 C April 22, 2022, 1:28 p.m. OK PyPy 3-64 TESTS 4 46 2150400 800
154493914 Yarussa C April 22, 2022, 12:02 p.m. OK PyPy 3-64 TESTS 4 46 2252800 800
154804800 person_here C April 24, 2022, 3:32 a.m. OK PyPy 3-64 TESTS 4 46 2252800 800
154505167 codingmasterhw C April 22, 2022, 1:58 p.m. OK PyPy 3-64 TESTS 4 46 2252800 800
154501823 nitish420 C April 22, 2022, 1:23 p.m. OK PyPy 3-64 TESTS 4 46 2252800 800
154538381 Artyom_2005 C April 22, 2022, 3:12 p.m. OK PyPy 3-64 TESTS 4 46 2457600 800
154885522 Dergo C April 24, 2022, 7:33 p.m. OK PyPy 3-64 TESTS 4 46 2662400 800
154901544 phlai326 C April 25, 2022, 3:52 a.m. OK Python 3 TESTS 4 30 0 800
154881620 nguyendung C April 24, 2022, 6:24 p.m. OK Python 3 TESTS 4 30 0 800
154626334 Erig C April 23, 2022, 6:53 a.m. OK Python 3 TESTS 4 30 0 800
154617827 Shariful_SEC C April 23, 2022, 5:10 a.m. OK Python 3 TESTS 4 30 0 800
154507930 codingmasterhw C April 22, 2022, 2:29 p.m. OK Python 3 TESTS 4 30 0 800
154507240 bigbardia2.0 C April 22, 2022, 2:21 p.m. OK Python 3 TESTS 4 30 0 800
154514046 sudhanshutiwari02 C April 22, 2022, 2:42 p.m. OK Python 3 TESTS 4 30 0 800
154901924 m7md_3llam C April 25, 2022, 3:59 a.m. OK Python 3 TESTS 4 30 0 800
154885307 UnreliableSpare C April 24, 2022, 7:29 p.m. OK Python 3 TESTS 4 31 0 800
154873154 Samoed C April 24, 2022, 4:18 p.m. OK Python 3 TESTS 4 31 0 800
154592426 DeadFox C April 22, 2022, 7:35 p.m. OK Rust 2021 TESTS 4 0 0 800
154679005 mocobeta C April 23, 2022, 1:11 p.m. OK Rust 2021 TESTS 4 0 102400 800

remove filters

Back to search problems