Codeforces Round 865 (Div. 1)

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
1815 Codeforces Round 865 (Div. 1) FINISHED False 8100 56214862 April 9, 2023, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14526 ) A Ian and Array Sorting PROGRAMMING greedy implementation math 1300

B'To thank Ian, Mary gifted an array a of length n to Ian. To make himself look smart, he wants to make the array in non-decreasing order by doing the following finitely many times: he chooses two adjacent elements a_i and a_{i+1} ( 1 <= i <= n-1 ), and increases both of them by 1 or decreases both of them by 1 . Note that, the elements of the array can become negative. As a smart person, you notice that, there are some arrays such that Ian cannot make it become non-decreasing order! Therefore, you decide to write a program to determine if it is possible to make the array in non-decreasing order. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of test cases follows. The first line of each test case consists of a single integer n ( 2 <= n <= 3 cdot10^5 ) -- the number of elements in the array. The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 1 <= a_i <= 10^9 ) -- the elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 3 cdot10^5 . For each test case, output "YES" if there exists a sequence of operations which make the array non-decreasing, else output "NO". You may print each letter in any case (for example, "YES", "Yes", "yes", "yEs" will all be recognized as positive answer). For the first test case, we can increase a_2 and a_3 both by 1 . The array is now [1, 4, 3] . Then we can decrease a_1 and a_2 both by 1 . The array is now [0, 3, 3] , which is sorted in non-decreasing order. So the answer is "YES". For the second test case, no matter how Ian perform the operations, a_1 will always be larger than a_2 . So the answer is "NO" and Ian cannot pretend to be smart. For the third test case, the array is already in non-decreasing order, so Ian does not need to do anything. '...

Tutorials

Editorial of Codeforces Round #865

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
201486437 mban259 A April 9, 2023, 2:54 p.m. OK C# 10 TESTS 29 93 30515200 1300
201500848 LeonidR A April 9, 2023, 3:08 p.m. OK C# 10 TESTS 29 108 31846400 1300
201481858 hos.lyric A April 9, 2023, 2:49 p.m. OK D TESTS 29 108 24064000 1300
201484095 Gassa A April 9, 2023, 2:52 p.m. OK D TESTS 29 109 13619200 1300
201486527 chro4896 A April 9, 2023, 2:54 p.m. OK GNU C11 TESTS 29 109 2355200 1300
201483039 20333333333 A April 9, 2023, 2:51 p.m. OK GNU C++14 TESTS 29 31 6963200 1300
201483252 Uagu A April 9, 2023, 2:51 p.m. OK GNU C++14 TESTS 29 62 1228800 1300
201488888 le0n A April 9, 2023, 2:57 p.m. OK GNU C++14 TESTS 29 62 1228800 1300
201483680 ztcakioi A April 9, 2023, 2:51 p.m. OK GNU C++14 TESTS 29 77 1228800 1300
201487392 Rita_Ross A April 9, 2023, 2:55 p.m. OK GNU C++14 TESTS 29 77 2457600 1300
201488253 Imdie A April 9, 2023, 2:56 p.m. OK GNU C++14 TESTS 29 78 1228800 1300
201487861 Potassium A April 9, 2023, 2:56 p.m. OK GNU C++14 TESTS 29 78 1228800 1300
201486106 waaitg A April 9, 2023, 2:54 p.m. OK GNU C++14 TESTS 29 78 1228800 1300
201484824 algebraist A April 9, 2023, 2:53 p.m. OK GNU C++14 TESTS 29 78 1228800 1300
201488989 Su_Zipei A April 9, 2023, 2:57 p.m. OK GNU C++14 TESTS 29 78 1228800 1300
201482190 MarbIue A April 9, 2023, 2:50 p.m. OK GNU C++17 TESTS 29 31 5836800 1300
201491866 lddlinan A April 9, 2023, 2:59 p.m. OK GNU C++17 TESTS 29 62 1228800 1300
201486445 gabrielwu A April 9, 2023, 2:54 p.m. OK GNU C++17 TESTS 29 77 1228800 1300
201504062 IamNewbie A April 9, 2023, 3:12 p.m. OK GNU C++17 TESTS 29 77 1228800 1300
201495854 Faitan A April 9, 2023, 3:03 p.m. OK GNU C++17 TESTS 29 77 4403200 1300
201481896 isaachew A April 9, 2023, 2:49 p.m. OK GNU C++17 TESTS 29 78 0 1300
201482932 zas111lll A April 9, 2023, 2:51 p.m. OK GNU C++17 TESTS 29 78 0 1300
201483031 gzchenben A April 9, 2023, 2:51 p.m. OK GNU C++17 TESTS 29 78 1228800 1300
201481462 SHZhang A April 9, 2023, 2:49 p.m. OK GNU C++17 TESTS 29 78 1228800 1300
201510116 ParsaS A April 9, 2023, 3:18 p.m. OK GNU C++17 TESTS 29 78 1228800 1300
201486671 Hackenbush A April 9, 2023, 2:54 p.m. OK GNU C++17 (64) TESTS 29 31 1228800 1300
201488939 zqyyy A April 9, 2023, 2:57 p.m. OK GNU C++17 (64) TESTS 29 31 3686400 1300
201482637 Kude A April 9, 2023, 2:50 p.m. OK GNU C++17 (64) TESTS 29 46 1228800 1300
201482014 Xellos A April 9, 2023, 2:49 p.m. OK GNU C++17 (64) TESTS 29 46 1228800 1300
201602273 stop A April 10, 2023, 1:23 a.m. OK GNU C++17 (64) TESTS 29 46 1228800 1300
201488979 lucasxia01 A April 9, 2023, 2:57 p.m. OK GNU C++17 (64) TESTS 29 46 2355200 1300
201575896 enslaved A April 9, 2023, 6:49 p.m. OK GNU C++17 (64) TESTS 29 46 2355200 1300
201586817 wisetree A April 9, 2023, 8:45 p.m. OK GNU C++17 (64) TESTS 29 46 2457600 1300
201573276 Olerinskiy A April 9, 2023, 6:26 p.m. OK GNU C++17 (64) TESTS 29 61 1228800 1300
201573654 Olerinskiy A April 9, 2023, 6:29 p.m. OK GNU C++17 (64) TESTS 29 61 1228800 1300
201482438 oleh1421 A April 9, 2023, 2:50 p.m. OK GNU C++20 (64) TESTS 29 31 2048000 1300
201481110 maspy A April 9, 2023, 2:48 p.m. OK GNU C++20 (64) TESTS 29 31 2457600 1300
201575881 sreesh_56 A April 9, 2023, 6:49 p.m. OK GNU C++20 (64) TESTS 29 46 0 1300
201507422 Elben85 A April 9, 2023, 3:15 p.m. OK GNU C++20 (64) TESTS 29 46 0 1300
201487378 rt3 A April 9, 2023, 2:55 p.m. OK GNU C++20 (64) TESTS 29 46 0 1300
201484625 maxplus A April 9, 2023, 2:52 p.m. OK GNU C++20 (64) TESTS 29 46 0 1300
201484013 shiven A April 9, 2023, 2:52 p.m. OK GNU C++20 (64) TESTS 29 46 0 1300
201604282 Rinors A April 10, 2023, 2:06 a.m. OK GNU C++20 (64) TESTS 29 46 1228800 1300
201603534 fmota A April 10, 2023, 1:51 a.m. OK GNU C++20 (64) TESTS 29 46 1228800 1300
201604851 watashikininarimasu A April 10, 2023, 2:20 a.m. OK GNU C++20 (64) TESTS 29 46 1228800 1300
201502422 profchi A April 9, 2023, 3:10 p.m. OK Java 11 TESTS 29 326 3891200 1300
201521426 TCchen A April 9, 2023, 3:33 p.m. OK Java 17 TESTS 29 249 5836800 1300
201576056 fervent_45 A April 9, 2023, 6:51 p.m. OK Java 17 TESTS 29 639 1024000 1300
201488999 fetetriste A April 9, 2023, 2:57 p.m. OK Java 8 TESTS 29 171 12697600 1300
201482281 iakovlev.zakhar A April 9, 2023, 2:50 p.m. OK Java 8 TESTS 29 171 14643200 1300
201498692 golions A April 9, 2023, 3:06 p.m. OK Java 8 TESTS 29 187 11468800 1300
201489412 goIions A April 9, 2023, 2:57 p.m. OK Java 8 TESTS 29 202 14643200 1300
201567041 formidablechief_27 A April 9, 2023, 5:42 p.m. OK Java 8 TESTS 29 202 15769600 1300
201485480 Tlatoani A April 9, 2023, 2:53 p.m. OK Kotlin 1.7 TESTS 29 826 140800000 1300
201499011 variance A April 9, 2023, 3:06 p.m. OK Ocaml TESTS 29 202 12595200 1300
201490760 shobonvip A April 9, 2023, 2:58 p.m. OK PyPy 3 TESTS 29 249 26419200 1300
201489487 SPD_9X2 A April 9, 2023, 2:57 p.m. OK PyPy 3 TESTS 29 452 26726400 1300
201505261 plevande A April 9, 2023, 3:13 p.m. OK PyPy 3-64 TESTS 29 140 31744000 1300
201498258 codicon A April 9, 2023, 3:06 p.m. OK PyPy 3-64 TESTS 29 140 40038400 1300
201495702 misorin A April 9, 2023, 3:03 p.m. OK PyPy 3-64 TESTS 29 140 46182400 1300
201577724 Mohamed_Hamed A April 9, 2023, 7:07 p.m. OK PyPy 3-64 TESTS 29 155 32153600 1300
201612225 prietukani A April 10, 2023, 4:24 a.m. OK PyPy 3-64 TESTS 29 155 40857600 1300
201482525 PyIsBestLang A April 9, 2023, 2:50 p.m. OK PyPy 3-64 TESTS 29 170 45465600 1300
201484511 titia A April 9, 2023, 2:52 p.m. OK PyPy 3-64 TESTS 29 171 40857600 1300
201514936 alxwen711 A April 9, 2023, 3:24 p.m. OK PyPy 3-64 TESTS 29 171 40960000 1300
201482733 Maruzensky A April 9, 2023, 2:50 p.m. OK PyPy 3-64 TESTS 29 171 41369600 1300
201607404 bandiaoz A April 10, 2023, 3:05 a.m. OK PyPy 3-64 TESTS 29 171 45465600 1300
201575138 fikre.anteneh A April 9, 2023, 6:42 p.m. OK Python 3 TESTS 29 218 22016000 1300
201571582 BabyBlue0514 A April 9, 2023, 6:12 p.m. OK Python 3 TESTS 29 280 22732800 1300
201609255 Hinokami-Kagura A April 10, 2023, 3:37 a.m. OK Python 3 TESTS 29 311 22425600 1300
201512727 Unwise A April 9, 2023, 3:22 p.m. OK Rust 2021 TESTS 29 30 4812800 1300
201481375 sansen A April 9, 2023, 2:48 p.m. OK Rust 2021 TESTS 29 31 14028800 1300

remove filters

Back to search problems