Codeforces Round 672 (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
1420 Codeforces Round 672 (Div. 2) FINISHED False 7200 136221863 Sept. 24, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23736 ) A Cubes Sorting PROGRAMMING math sortings

B'Oh, that 's funny, is it? Oh it 's funny? Because we 've been at this for twelve hours and you haven 't solved it either, so I don 't know why you 're laughing. You 've got one hour! Solve it! Wheatley decided to try to make a test chamber. He made a nice test chamber, but there was only one detail absent -- cubes. For completing the chamber Wheatley needs n cubes. i -th cube has a volume a_i . Wheatley has to place cubes in such a way that they would be sorted in a non-decreasing order by their volume. Formally, for each i>1 , a_{i-1} <= a_i must hold. To achieve his goal, Wheatley can exchange two neighbouring cubes. It means that for any i>1 you can exchange cubes on positions i-1 and i . But there is a problem: Wheatley is very impatient. If Wheatley needs more than frac{n cdot (n-1)}{2}-1 exchange operations, he won 't do this boring work. Wheatly wants to know: can cubes be sorted under this conditions? Each test contains multiple test cases. The first line contains one positive integer t ( 1 <= t <= 1000 ), denoting the number of test cases. Description of the test cases follows. The first line of each test case contains one positive integer n ( 2 <= n <= 5 cdot 10^4 ) -- number of cubes. The second line contains n positive integers a_i ( 1 <= a_i <= 10^9 ) -- volumes of cubes. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print a word in a single line: "YES" (without quotation marks) if the cubes can be sorted and "NO" (without quotation marks) otherwise. In the first test case it is possible to sort all the cubes in 7 exchanges. In the second test case the cubes are already sorted. In the third test case we can make 0 exchanges, but the cubes are not sorted yet, so the answer is "NO". '...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
93737732 finch_404 A Sept. 24, 2020, 11:13 p.m. OK Clang++17 Diagnostics TESTS 27 592 15564800
93739346 BugLeave A Sept. 25, 2020, 12:30 a.m. OK GNU C11 TESTS 27 46 0
93715347 mradul.mr20 A Sept. 24, 2020, 4:28 p.m. OK GNU C11 TESTS 26 46 204800
93729751 Redoy_Kumar A Sept. 24, 2020, 7:32 p.m. OK GNU C11 TESTS 27 46 204800
93742164 avi_p A Sept. 25, 2020, 2:03 a.m. OK GNU C11 TESTS 27 46 204800
93745679 Wenbo888 A Sept. 25, 2020, 3:27 a.m. OK GNU C11 TESTS 27 46 204800
93752263 JAHID_KARIM A Sept. 25, 2020, 5:33 a.m. OK GNU C11 TESTS 27 46 409600
93741577 brench11 A Sept. 25, 2020, 1:46 a.m. OK GNU C11 TESTS 27 46 409600
93747517 pr1yan3hu A Sept. 25, 2020, 4:06 a.m. OK GNU C11 TESTS 27 46 409600
93750146 jcbwhite A Sept. 25, 2020, 4:57 a.m. OK GNU C11 TESTS 27 46 409600
93746800 HrushikeshKale A Sept. 25, 2020, 3:50 a.m. OK GNU C11 TESTS 27 46 716800
93739672 SuperTNT A Sept. 25, 2020, 12:41 a.m. OK GNU C++11 TESTS 27 30 0
93712023 User_Carrot A Sept. 24, 2020, 4:19 p.m. OK GNU C++11 TESTS 26 31 204800
93739046 autistic_boy A Sept. 25, 2020, 12:20 a.m. OK GNU C++11 TESTS 27 31 204800
93746844 ZASAZ_Admin A Sept. 25, 2020, 3:51 a.m. OK GNU C++11 TESTS 27 31 204800
93750179 yzang A Sept. 25, 2020, 4:58 a.m. OK GNU C++11 TESTS 27 31 204800
93741673 Daniel-Y A Sept. 25, 2020, 1:49 a.m. OK GNU C++11 TESTS 27 31 409600
93740080 stone41123 A Sept. 25, 2020, 12:58 a.m. OK GNU C++11 TESTS 27 31 409600
93741579 theHermit A Sept. 25, 2020, 1:46 a.m. OK GNU C++11 TESTS 27 31 512000
93740033 STDquantum A Sept. 25, 2020, 12:57 a.m. OK GNU C++11 TESTS 27 31 1228800
93741605 Sakura-hero A Sept. 25, 2020, 1:47 a.m. OK GNU C++11 TESTS 27 31 9625600
93748430 gkftndlTek A Sept. 25, 2020, 4:25 a.m. OK GNU C++14 TESTS 27 46 0
93747521 gkftndlTek A Sept. 25, 2020, 4:06 a.m. OK GNU C++14 TESTS 27 46 0
93738369 Trys_Like_Buffalo A Sept. 24, 2020, 11:48 p.m. OK GNU C++14 TESTS 27 46 0
93745917 extra_2001 A Sept. 25, 2020, 3:31 a.m. OK GNU C++14 TESTS 27 46 204800
93748587 19kanu30 A Sept. 25, 2020, 4:28 a.m. OK GNU C++14 TESTS 27 46 204800
93741067 tony_stark2000 A Sept. 25, 2020, 1:31 a.m. OK GNU C++14 TESTS 27 46 204800
93744609 hdilantha A Sept. 25, 2020, 3:05 a.m. OK GNU C++14 TESTS 27 46 204800
93748868 Probito A Sept. 25, 2020, 4:33 a.m. OK GNU C++14 TESTS 27 46 204800
93749190 gkftndlTek A Sept. 25, 2020, 4:40 a.m. OK GNU C++14 TESTS 27 46 204800
93753186 AdityaSonani472 A Sept. 25, 2020, 5:47 a.m. OK GNU C++14 TESTS 27 46 204800
93740981 abc864197532 A Sept. 25, 2020, 1:28 a.m. OK GNU C++17 TESTS 27 46 0
93746724 Wily_33 A Sept. 25, 2020, 3:48 a.m. OK GNU C++17 TESTS 27 46 0
93735492 Alex_Lorintz A Sept. 24, 2020, 9:41 p.m. OK GNU C++17 TESTS 27 46 0
93737831 PedroAlmeida A Sept. 24, 2020, 11:20 p.m. OK GNU C++17 TESTS 27 46 0
93751248 ashuKS29 A Sept. 25, 2020, 5:16 a.m. OK GNU C++17 TESTS 27 46 204800
93752288 sumon_ahmed A Sept. 25, 2020, 5:33 a.m. OK GNU C++17 TESTS 27 46 204800
93747563 Nitaray A Sept. 25, 2020, 4:07 a.m. OK GNU C++17 TESTS 27 46 204800
93746015 MysteryEquation A Sept. 25, 2020, 3:33 a.m. OK GNU C++17 TESTS 27 46 204800
93741217 hsez A Sept. 25, 2020, 1:36 a.m. OK GNU C++17 TESTS 27 46 204800
93738653 Svanh A Sept. 25, 2020, 12:01 a.m. OK GNU C++17 TESTS 27 46 204800
93726438 shyam123 A Sept. 24, 2020, 6:47 p.m. OK GNU C++17 (64) TESTS 27 31 204800
93750933 Sakif A Sept. 25, 2020, 5:11 a.m. OK GNU C++17 (64) TESTS 27 46 0
93739921 mah_python A Sept. 25, 2020, 12:52 a.m. OK GNU C++17 (64) TESTS 27 46 0
93732787 aguilacoffee A Sept. 24, 2020, 8:30 p.m. OK GNU C++17 (64) TESTS 27 46 0
93734922 ankushkhanna A Sept. 24, 2020, 9:23 p.m. OK GNU C++17 (64) TESTS 27 46 0
93737254 Clu3l3ss A Sept. 24, 2020, 10:51 p.m. OK GNU C++17 (64) TESTS 27 46 0
93726454 rds__98 A Sept. 24, 2020, 6:48 p.m. OK GNU C++17 (64) TESTS 27 46 0
93735559 invisible_guest A Sept. 24, 2020, 9:43 p.m. OK GNU C++17 (64) TESTS 27 46 204800
93742565 LethalPuppy A Sept. 25, 2020, 2:13 a.m. OK GNU C++17 (64) TESTS 27 46 204800
93744764 smax A Sept. 25, 2020, 3:08 a.m. OK GNU C++17 (64) TESTS 27 46 204800
93724700 torus711 A Sept. 24, 2020, 6:28 p.m. OK Haskell TESTS 27 140 6451200
93731672 tonymontaro A Sept. 24, 2020, 8:07 p.m. OK Java 11 TESTS 27 186 0
93728271 akmo A Sept. 24, 2020, 7:11 p.m. OK Java 11 TESTS 27 187 0
93752684 anshum_it_is A Sept. 25, 2020, 5:39 a.m. OK Java 11 TESTS 27 202 0
93751025 CoronaTime A Sept. 25, 2020, 5:13 a.m. OK Java 11 TESTS 27 202 0
93745412 skittles1412 A Sept. 25, 2020, 3:22 a.m. OK Java 11 TESTS 27 202 0
93741741 qlf9 A Sept. 25, 2020, 1:51 a.m. OK Java 11 TESTS 27 202 0
93726025 vipin__sharma A Sept. 24, 2020, 6:42 p.m. OK Java 11 TESTS 27 202 0
93722834 gssakash A Sept. 24, 2020, 6:13 p.m. OK Java 11 TESTS 26 202 0
93727936 gsahil216 A Sept. 24, 2020, 7:07 p.m. OK Java 11 TESTS 27 217 0
93751170 liubenjamin A Sept. 25, 2020, 5:15 a.m. OK Java 11 TESTS 27 218 0
93752830 ujjwalavishek A Sept. 25, 2020, 5:41 a.m. OK Java 8 TESTS 27 124 0
93750325 tirth9960 A Sept. 25, 2020, 5:01 a.m. OK Java 8 TESTS 27 124 0
93748034 zayn8917 A Sept. 25, 2020, 4:17 a.m. OK Java 8 TESTS 27 124 0
93745124 Pranay2516 A Sept. 25, 2020, 3:16 a.m. OK Java 8 TESTS 27 124 0
93728324 lzhang A Sept. 24, 2020, 7:12 p.m. OK Java 8 TESTS 27 139 0
93753163 rohanakar A Sept. 25, 2020, 5:47 a.m. OK Java 8 TESTS 27 140 0
93743381 bohot_hard_123 A Sept. 25, 2020, 2:35 a.m. OK Java 8 TESTS 27 140 0
93727420 deepakpra A Sept. 24, 2020, 7 p.m. OK Java 8 TESTS 27 140 0
93727000 deepakpra A Sept. 24, 2020, 6:54 p.m. OK Java 8 TESTS 27 140 0
93726511 Peter_Fahmi A Sept. 24, 2020, 6:48 p.m. OK Java 8 TESTS 27 140 0
93751916 Spheniscine A Sept. 25, 2020, 5:27 a.m. OK Kotlin TESTS 27 156 0
93729846 Mirimax A Sept. 24, 2020, 7:34 p.m. OK Kotlin TESTS 27 202 716800
93737968 miruomiruomi A Sept. 24, 2020, 11:28 p.m. OK MS C++ TESTS 27 109 409600
93746668 Prycom A Sept. 25, 2020, 3:47 a.m. OK MS C++ 2017 TESTS 27 109 409600
93752576 jingzi523 A Sept. 25, 2020, 5:38 a.m. OK MS C++ 2017 TESTS 27 124 0
93716477 544432 A Sept. 24, 2020, 4:31 p.m. OK MS C++ 2017 TESTS 26 124 409600
93745113 yanndsal A Sept. 25, 2020, 3:16 a.m. OK MS C++ 2017 TESTS 27 124 614400
93724603 explorer_sifat A Sept. 24, 2020, 6:27 p.m. OK Node.js TESTS 27 155 6758400
93730237 realnimish A Sept. 24, 2020, 7:40 p.m. OK PyPy 2 TESTS 27 155 8908800
93721503 beethoven97 A Sept. 24, 2020, 6:05 p.m. OK PyPy 2 TESTS 26 155 10137600
93740292 uttharapally.chandra A Sept. 25, 2020, 1:05 a.m. OK PyPy 3 TESTS 27 187 11264000
93725217 kaleabasfaw2010 A Sept. 24, 2020, 6:34 p.m. OK PyPy 3 TESTS 27 202 7987200
93728024 Anuranjan_Pandey A Sept. 24, 2020, 7:08 p.m. OK PyPy 3 TESTS 27 202 8704000
93724785 kaleabasfaw2010 A Sept. 24, 2020, 6:29 p.m. OK PyPy 3 TESTS 27 202 8704000
93721759 Akhil_Rautela A Sept. 24, 2020, 6:06 p.m. OK PyPy 3 TESTS 26 202 10444800
93740240 uttharapally.chandra A Sept. 25, 2020, 1:03 a.m. OK PyPy 3 TESTS 27 202 11161600
93723275 manhar A Sept. 24, 2020, 6:16 p.m. OK PyPy 3 TESTS 27 202 11161600
93724130 diego.cruz001 A Sept. 24, 2020, 6:23 p.m. OK PyPy 3 TESTS 27 217 8601600
93745112 Why_WA A Sept. 25, 2020, 3:16 a.m. OK PyPy 3 TESTS 27 218 8499200
93724226 kaleabasfaw2010 A Sept. 24, 2020, 6:24 p.m. OK PyPy 3 TESTS 27 233 11161600
93750629 coder_prakhar A Sept. 25, 2020, 5:06 a.m. OK Python 3 TESTS 27 140 5529600
93752102 code_forces_handle A Sept. 25, 2020, 5:30 a.m. OK Python 3 TESTS 27 140 5836800
93749463 rohit_lohar A Sept. 25, 2020, 4:44 a.m. OK Python 3 TESTS 27 155 5427200
93745532 SmitVavliya A Sept. 25, 2020, 3:24 a.m. OK Python 3 TESTS 27 155 5427200
93732313 tamahom A Sept. 24, 2020, 8:20 p.m. OK Python 3 TESTS 27 155 5427200
93726334 yans0o0o0 A Sept. 24, 2020, 6:46 p.m. OK Python 3 TESTS 27 155 5427200
93749559 abhi.tiwari A Sept. 25, 2020, 4:46 a.m. OK Python 3 TESTS 27 155 5529600
93745226 sid_121212 A Sept. 25, 2020, 3:18 a.m. OK Python 3 TESTS 27 155 5529600
93742784 laskdkmg A Sept. 25, 2020, 2:19 a.m. OK Python 3 TESTS 27 155 5529600
93741355 sduwh_dd A Sept. 25, 2020, 1:40 a.m. OK Python 3 TESTS 27 155 5529600
93737864 sansen A Sept. 24, 2020, 11:22 p.m. OK Rust TESTS 27 31 2150400
93738114 o2c A Sept. 24, 2020, 11:34 p.m. OK Rust TESTS 27 61 1536000
93713777 freshnewname A Sept. 24, 2020, 4:24 p.m. OK Rust TESTS 26 140 3481600
93721508 IvanDyachenko A Sept. 24, 2020, 6:05 p.m. OK Scala TESTS 26 686 10240000

remove filters

Back to search problems