Codeforces Round 788 (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
1670 Codeforces Round 788 (Div. 2) FINISHED False 7200 79975499 May 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15459 ) A Prof. Slim PROGRAMMING greedy implementation sortings 800

B'One day Prof. Slim decided to leave the kingdom of the GUC to join the kingdom of the GIU. He was given an easy online assessment to solve before joining the GIU. Citizens of the GUC were happy sad to see the prof leaving, so they decided to hack into the system and change the online assessment into a harder one so that he stays at the GUC. After a long argument, they decided to change it into the following problem. Given an array of n integers a_1,a_2, ldots,a_n , where a_{i} neq 0 , check if you can make this array sorted by using the following operation any number of times (possibly zero). An array is sorted if its elements are arranged in a non-decreasing order. Prof. Slim saw that the problem is still too easy and isn 't worth his time, so he decided to give it to you to solve. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains a single integer n ( 1 <= n <= 10^{5} ) -- the length of the array a . The next line contain n integers a_1, a_2, ldots, a_n ( -10^9 <= a_{i} <= 10^9 , a_{i} neq 0 ) separated by spaces describing elements of the array a . It is guaranteed that the sum of n over all test cases doesn 't exceed 10^5 . For each test case, print "YES" if the array can be sorted in the non-decreasing order, otherwise print "NO". You can print each letter in any case (upper or lower). In the first test case, there is no way to make the array sorted using the operation any number of times. In the second test case, the array is already sorted. In the third test case, we can swap the sign of the 1 -st element with the sign of the 5 -th element, and the sign of the 3 -rd element with the sign of the 6 -th element, this way the array will be sorted. In the fourth test case, there is no way to make the array sorted using the operation any'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156147573 ushiromiya7 A May 7, 2022, 12:44 a.m. OK C# 10 TESTS 23 109 9625600 800
156127201 TheILICH A May 6, 2022, 5:49 p.m. OK C# 8 TESTS 23 108 9830400 800
156131707 Louiii27 A May 6, 2022, 6:38 p.m. OK GNU C11 TESTS 23 31 409600 800
156110010 Abhishek_Tewatia A May 6, 2022, 3:53 p.m. OK GNU C11 TESTS 23 46 409600 800
156116648 ztfgsxdgyt A May 6, 2022, 4:16 p.m. OK GNU C11 TESTS 23 46 409600 800
156112168 Axisflow A May 6, 2022, 4 p.m. OK GNU C11 TESTS 23 61 409600 800
156114320 ericcire0413 A May 6, 2022, 4:08 p.m. OK GNU C11 TESTS 23 967 409600 800
156145711 CQYZWJH A May 6, 2022, 11:33 p.m. OK GNU C++14 TESTS 23 15 512000 800
156150359 Adoreou A May 7, 2022, 2:03 a.m. OK GNU C++14 TESTS 23 31 409600 800
156150262 siliconoxide4 A May 7, 2022, 2 a.m. OK GNU C++14 TESTS 23 31 409600 800
156150126 duoluoluo A May 7, 2022, 1:57 a.m. OK GNU C++14 TESTS 23 31 409600 800
156149407 Syf2020 A May 7, 2022, 1:38 a.m. OK GNU C++14 TESTS 23 31 409600 800
156152784 Anivia_ A May 7, 2022, 2:55 a.m. OK GNU C++14 TESTS 23 31 409600 800
156153564 NavSkyc A May 7, 2022, 3:11 a.m. OK GNU C++14 TESTS 23 31 409600 800
156154430 SrinivasTeja A May 7, 2022, 3:29 a.m. OK GNU C++14 TESTS 23 31 409600 800
156158874 vidm A May 7, 2022, 4:57 a.m. OK GNU C++14 TESTS 23 31 409600 800
156158859 wsygxlj A May 7, 2022, 4:56 a.m. OK GNU C++14 TESTS 23 31 409600 800
156146939 jhc_123 A May 7, 2022, 12:23 a.m. OK GNU C++17 TESTS 23 15 17203200 800
156157705 Legendary_Grand_newbie A May 7, 2022, 4:35 a.m. OK GNU C++17 TESTS 23 31 409600 800
156156644 onesun A May 7, 2022, 4:14 a.m. OK GNU C++17 TESTS 23 31 409600 800
156156380 Alion.q A May 7, 2022, 4:08 a.m. OK GNU C++17 TESTS 23 31 409600 800
156155977 smsh16 A May 7, 2022, 4 a.m. OK GNU C++17 TESTS 23 31 409600 800
156158807 ayush.saini10 A May 7, 2022, 4:55 a.m. OK GNU C++17 TESTS 23 31 409600 800
156162335 Prey7 A May 7, 2022, 5:53 a.m. OK GNU C++17 TESTS 23 31 409600 800
156161636 0_r_c_u_s A May 7, 2022, 5:43 a.m. OK GNU C++17 TESTS 23 31 409600 800
156159776 Akhil_Rautela A May 7, 2022, 5:14 a.m. OK GNU C++17 TESTS 23 31 409600 800
156159114 Nikhil2121 A May 7, 2022, 5:02 a.m. OK GNU C++17 TESTS 23 31 409600 800
156156491 dqsjysgs A May 7, 2022, 4:11 a.m. OK GNU C++17 (64) TESTS 23 15 409600 800
156146644 xiece666 A May 7, 2022, 12:10 a.m. OK GNU C++17 (64) TESTS 23 15 1843200 800
156129898 Nanak_09Jul A May 6, 2022, 6:16 p.m. OK GNU C++17 (64) TESTS 23 15 15872000 800
156119375 Omar_mabrouk A May 6, 2022, 4:27 p.m. OK GNU C++17 (64) TESTS 23 15 16076800 800
156119637 sakshi_Kumar A May 6, 2022, 4:28 p.m. OK GNU C++17 (64) TESTS 23 30 409600 800
156125880 mandy_17 A May 6, 2022, 5:37 p.m. OK GNU C++17 (64) TESTS 23 30 819200 800
156158241 WAcrazier A May 7, 2022, 4:44 a.m. OK GNU C++17 (64) TESTS 23 31 409600 800
156157020 PurpleCrayon A May 7, 2022, 4:22 a.m. OK GNU C++17 (64) TESTS 23 31 409600 800
156156570 lovezah A May 7, 2022, 4:13 a.m. OK GNU C++17 (64) TESTS 23 31 409600 800
156151614 XHYU61 A May 7, 2022, 2:31 a.m. OK GNU C++17 (64) TESTS 23 31 409600 800
156153274 OmarAnalog A May 7, 2022, 3:05 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156151520 whutzym A May 7, 2022, 2:29 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156150415 Spectre97 A May 7, 2022, 2:04 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156148318 Cypher70 A May 7, 2022, 1:09 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156147525 Patricky A May 7, 2022, 12:42 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156153484 Hritik_git A May 7, 2022, 3:09 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156157407 Yura_01 A May 7, 2022, 4:29 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156158370 _su1sen A May 7, 2022, 4:47 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156160263 omar.e.gado A May 7, 2022, 5:21 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156161502 hghgh A May 7, 2022, 5:41 a.m. OK GNU C++20 (64) TESTS 23 15 409600 800
156149230 zelknow26 A May 7, 2022, 1:33 a.m. OK Go TESTS 23 93 2150400 800
156132159 LXL A May 6, 2022, 6:43 p.m. OK Go TESTS 23 93 2150400 800
156132645 Satyaa A May 6, 2022, 6:50 p.m. OK Java 11 TESTS 23 171 0 800
156124692 Halix A May 6, 2022, 5:28 p.m. OK Java 11 TESTS 23 171 0 800
156150521 humwawe A May 7, 2022, 2:07 a.m. OK Java 11 TESTS 23 187 0 800
156159343 sf14t A May 7, 2022, 5:06 a.m. OK Java 11 TESTS 23 202 0 800
156145716 nadaabdo588 A May 6, 2022, 11:34 p.m. OK Java 11 TESTS 23 202 0 800
156126337 henrychenOutlook A May 6, 2022, 5:41 p.m. OK Java 11 TESTS 23 202 0 800
156145757 nadaabdo588 A May 6, 2022, 11:35 p.m. OK Java 11 TESTS 23 218 0 800
156138634 yash13203 A May 6, 2022, 8:18 p.m. OK Java 11 TESTS 23 233 0 800
156124183 Wuya A May 6, 2022, 5:25 p.m. OK Java 11 TESTS 23 233 2560000 800
156137925 ccj123 A May 6, 2022, 8:06 p.m. OK Java 11 TESTS 23 249 0 800
156138118 malekelkassas A May 6, 2022, 8:09 p.m. OK Java 8 TESTS 23 124 0 800
156138086 dev_14 A May 6, 2022, 8:08 p.m. OK Java 8 TESTS 23 124 0 800
156133328 Koka A May 6, 2022, 6:58 p.m. OK Java 8 TESTS 23 124 0 800
156128898 Abdallah_Ragab00 A May 6, 2022, 6:06 p.m. OK Java 8 TESTS 23 124 0 800
156126190 govindrajput A May 6, 2022, 5:40 p.m. OK Java 8 TESTS 23 124 0 800
156155939 Self7 A May 7, 2022, 3:59 a.m. OK Java 8 TESTS 23 139 0 800
156128169 vaibhav_1710 A May 6, 2022, 5:59 p.m. OK Java 8 TESTS 23 139 0 800
156118276 ShivanRawat19 A May 6, 2022, 4:22 p.m. OK Java 8 TESTS 23 139 0 800
156111753 abhijitpuri17092001 A May 6, 2022, 3:59 p.m. OK Java 8 TESTS 23 139 0 800
156111768 DoPractice A May 6, 2022, 3:59 p.m. OK Java 8 TESTS 23 140 0 800
156132188 PeredurOmega A May 6, 2022, 6:44 p.m. OK Kotlin 1.4 TESTS 23 187 3174400 800
156154921 ripity A May 7, 2022, 3:39 a.m. OK Kotlin 1.6 TESTS 23 265 614400 800
156144848 thegeman A May 6, 2022, 10:56 p.m. OK Kotlin 1.6 TESTS 23 295 3686400 800
156157151 deyilhou A May 7, 2022, 4:24 a.m. OK MS C++ 2017 TESTS 23 31 409600 800
156109183 jebi_jok A May 6, 2022, 3:51 p.m. OK MS C++ 2017 TESTS 23 93 409600 800
156126368 zeritonik A May 6, 2022, 5:41 p.m. OK MS C++ 2017 TESTS 23 108 409600 800
156124545 xsc A May 6, 2022, 5:27 p.m. OK MS C++ 2017 TESTS 23 109 409600 800
156128588 JUBA_700corpses A May 6, 2022, 6:03 p.m. OK MS C++ 2017 TESTS 23 109 512000 800
156112327 LSY530 A May 6, 2022, 4:01 p.m. OK MS C++ 2017 TESTS 23 109 819200 800
156152569 Mooyin A May 7, 2022, 2:50 a.m. OK MS C++ 2017 TESTS 23 109 1024000 800
156117030 huanghu_s A May 6, 2022, 4:17 p.m. OK MS C++ 2017 TESTS 23 109 1228800 800
156118174 NewBieQiu A May 6, 2022, 4:22 p.m. OK MS C++ 2017 TESTS 23 124 819200 800
156111889 Ilko_Andriy A May 6, 2022, 3:59 p.m. OK MS C++ 2017 TESTS 23 124 819200 800
156156865 yoralbayev A May 7, 2022, 4:19 a.m. OK PHP TESTS 23 108 7782400 800
156119323 conqueror_of_titia A May 6, 2022, 4:26 p.m. OK PyPy 2 TESTS 23 140 8396800 800
156124541 1_2_3_4_5_9 A May 6, 2022, 5:27 p.m. OK PyPy 2 TESTS 23 155 8806400 800
156120971 acorn11 A May 6, 2022, 4:32 p.m. OK PyPy 2 TESTS 23 389 8192000 800
156144271 KanishkGoel A May 6, 2022, 10:33 p.m. OK PyPy 3 TESTS 23 155 8908800 800
156124667 FrozenKandy A May 6, 2022, 5:28 p.m. OK PyPy 3 TESTS 23 187 9318400 800
156157940 rainap A May 7, 2022, 4:39 a.m. OK PyPy 3 TESTS 23 202 10854400 800
156161815 Dinesh_devanaboina A May 7, 2022, 5:45 a.m. OK PyPy 3 TESTS 23 404 11878400 800
156134123 Pslnd A May 6, 2022, 7:08 p.m. OK PyPy 3 TESTS 23 405 11059200 800
156137721 Eselidze A May 6, 2022, 8:02 p.m. OK PyPy 3 TESTS 23 436 10752000 800
156130144 seen_pooj A May 6, 2022, 6:19 p.m. OK PyPy 3 TESTS 23 436 10854400 800
156130732 Naren_1234 A May 6, 2022, 6:26 p.m. OK PyPy 3 TESTS 23 451 10956800 800
156117243 mittal.abhishek2003 A May 6, 2022, 4:18 p.m. OK PyPy 3 TESTS 23 468 11571200 800
156125678 nitish420 A May 6, 2022, 5:36 p.m. OK PyPy 3-64 TESTS 23 124 16179200 800
156150113 IkshitG A May 7, 2022, 1:57 a.m. OK PyPy 3-64 TESTS 23 155 14131200 800
156128386 ifte104 A May 6, 2022, 6:01 p.m. OK PyPy 3-64 TESTS 23 170 16588800 800
156147711 wolfram_ A May 7, 2022, 12:48 a.m. OK PyPy 3-64 TESTS 23 187 15769600 800
156131795 sakshatmali A May 6, 2022, 6:39 p.m. OK PyPy 3-64 TESTS 23 202 13619200 800
156144892 unknownSolver A May 6, 2022, 10:57 p.m. OK PyPy 3-64 TESTS 23 217 15564800 800
156118756 Vermeil A May 6, 2022, 4:24 p.m. OK PyPy 3-64 TESTS 23 280 16588800 800
156137286 _icy_ A May 6, 2022, 7:55 p.m. OK PyPy 3-64 TESTS 23 296 13209600 800
156118682 unknownSolver A May 6, 2022, 4:24 p.m. OK PyPy 3-64 TESTS 23 296 15769600 800
156108997 ikzzi A May 6, 2022, 3:50 p.m. OK PyPy 3-64 TESTS 23 327 14848000 800
156128409 ifte104 A May 6, 2022, 6:01 p.m. OK Python 3 TESTS 23 124 7782400 800
156118464 jinhwanlazy A May 6, 2022, 4:23 p.m. OK Python 3 TESTS 23 140 7680000 800
156114820 abcsumit A May 6, 2022, 4:09 p.m. OK Python 3 TESTS 23 140 7680000 800
156158797 I_am_dumbbbb A May 7, 2022, 4:55 a.m. OK Python 3 TESTS 23 155 7680000 800
156149302 Shah.Zaib A May 7, 2022, 1:36 a.m. OK Python 3 TESTS 23 155 7680000 800
156132952 lance.correia616 A May 6, 2022, 6:53 p.m. OK Python 3 TESTS 23 155 7680000 800
156112245 def_checker A May 6, 2022, 4 p.m. OK Python 3 TESTS 23 155 7680000 800
156110312 rheak01 A May 6, 2022, 3:54 p.m. OK Python 3 TESTS 23 155 7987200 800
156150847 MuhammadAMMAR A May 7, 2022, 2:15 a.m. OK Python 3 TESTS 23 171 7680000 800
156135327 mo_hit_666 A May 6, 2022, 7:25 p.m. OK Python 3 TESTS 23 171 7680000 800

remove filters

Back to search problems