Codeforces Global Round 9

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
1375 Codeforces Global Round 9 FINISHED False 9000 137949299 July 4, 2020, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3090 ) E Inversion SwapSort PROGRAMMING constructive algorithms greedy sortings

B'Madeline has an array a of n integers. A pair (u, v) of integers forms an inversion in a if: Madeline recently found a magical paper, which allows her to write two indices u and v and swap the values a_u and a_v . Being bored, she decided to write a list of pairs (u_i, v_i) with the following conditions: Construct such a list or determine that no such list exists. If there are multiple possible answers, you may find any of them. The first line of the input contains a single integer n ( 1 <= n <= 1000 ) -- the length of the array. Next line contains n integers a_1,a_2,...,a_n (1 <= a_i <= 10^9) -- elements of the array. Print -1 if no such list exists. Otherwise in the first line you should print a single integer m ( 0 <= m <= dfrac{n(n-1)}{2} ) -- number of pairs in the list. The i -th of the following m lines should contain two integers u_i, v_i ( 1 <= u_i < v_i <= n ). If there are multiple possible answers, you may find any of them. In the first sample test case the array will change in this order [3,1,2] rightarrow [2,1,3] rightarrow [1,2,3] . In the second sample test case it will be [1,8,1,6] rightarrow [1,6,1,8] rightarrow [1,1,6,8] . In the third sample test case the array is already sorted. '...

Tutorials

79731

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
85970652 hos.lyric E July 4, 2020, 4 p.m. OK D TESTS 24 265 18534400
85978583 Gassa E July 4, 2020, 4:22 p.m. OK D TESTS 24 342 18534400
86025337 LJC00118 E July 5, 2020, 5:23 a.m. OK GNU C++11 TESTS 24 46 10240000
85990744 emoairx E July 4, 2020, 4:59 p.m. OK GNU C++11 TESTS 24 62 10240000
86019665 ouuan E July 5, 2020, 3:02 a.m. OK GNU C++11 TESTS 24 77 16486400
86019355 xay542I E July 5, 2020, 2:53 a.m. OK GNU C++11 TESTS 24 78 20377600
86019315 xay5421 E July 5, 2020, 2:52 a.m. OK GNU C++11 TESTS 24 78 20377600
85990786 xuanyi E July 4, 2020, 4:59 p.m. OK GNU C++11 TESTS 24 78 20377600
86020134 minyzero E July 5, 2020, 3:15 a.m. OK GNU C++11 TESTS 24 109 10240000
85977512 Nazrin E July 4, 2020, 4:19 p.m. OK GNU C++11 TESTS 24 109 11980800
85975432 BQAC E July 4, 2020, 4:13 p.m. OK GNU C++11 TESTS 24 109 11980800
85990809 MonkeyKing E July 4, 2020, 4:59 p.m. OK GNU C++11 TESTS 24 124 3891200
85968442 BSBandme E July 4, 2020, 3:54 p.m. OK GNU C++14 TESTS 24 93 6963200
86025763 acccccccc E July 5, 2020, 5:31 a.m. OK GNU C++14 TESTS 24 93 10035200
86018547 A.K.E.E. E July 5, 2020, 2:27 a.m. OK GNU C++14 TESTS 24 93 11878400
85991052 Lebossle E July 4, 2020, 5 p.m. OK GNU C++14 TESTS 24 108 7065600
85999653 krazy E July 4, 2020, 5:53 p.m. OK GNU C++14 TESTS 24 108 9932800
86025275 acccccccc E July 5, 2020, 5:22 a.m. OK GNU C++14 TESTS 24 108 10035200
85999531 racsosabe E July 4, 2020, 5:52 p.m. OK GNU C++14 TESTS 24 108 10035200
85982229 Retro3014 E July 4, 2020, 4:33 p.m. OK GNU C++14 TESTS 24 108 10035200
85979350 ILoveSetsuna E July 4, 2020, 4:24 p.m. OK GNU C++14 TESTS 24 108 10035200
85975591 dlalswp25 E July 4, 2020, 4:13 p.m. OK GNU C++14 TESTS 24 108 10035200
85978842 disangan233 E July 4, 2020, 4:23 p.m. OK GNU C++17 TESTS 24 61 32153600
85960215 LayCurse E July 4, 2020, 3:35 p.m. OK GNU C++17 TESTS 24 61 114073600
85971826 JOHNKRAM E July 4, 2020, 4:03 p.m. OK GNU C++17 TESTS 24 77 13824000
85964049 mrscherry E July 4, 2020, 3:44 p.m. OK GNU C++17 TESTS 24 93 6963200
85998861 abeker E July 4, 2020, 5:48 p.m. OK GNU C++17 TESTS 24 93 10035200
85997516 temmmmmie E July 4, 2020, 5:14 p.m. OK GNU C++17 TESTS 24 93 13516800
85991715 Radewoosh E July 4, 2020, 5:02 p.m. OK GNU C++17 TESTS 24 93 15872000
85975551 sys. E July 4, 2020, 4:13 p.m. OK GNU C++17 TESTS 24 108 3788800
85973596 tlwpdus E July 4, 2020, 4:08 p.m. OK GNU C++17 TESTS 24 108 5529600
85990109 orz E July 4, 2020, 4:57 p.m. OK GNU C++17 TESTS 24 108 7680000
85967524 yosupo E July 4, 2020, 3:52 p.m. OK GNU C++17 (64) TESTS 24 46 11776000
85969897 Reyna E July 4, 2020, 3:58 p.m. OK GNU C++17 (64) TESTS 24 93 4300800
85961734 jiangly E July 4, 2020, 3:39 p.m. OK GNU C++17 (64) TESTS 24 93 4300800
85963595 user202729_ E July 4, 2020, 3:43 p.m. OK GNU C++17 (64) TESTS 24 93 8601600
85963141 majk E July 4, 2020, 3:42 p.m. OK GNU C++17 (64) TESTS 24 93 8601600
86009033 wwdd E July 4, 2020, 8:16 p.m. OK GNU C++17 (64) TESTS 24 93 11673600
86000183 YangDavid E July 4, 2020, 5:57 p.m. OK GNU C++17 (64) TESTS 24 93 11673600
85985255 ollpu E July 4, 2020, 4:43 p.m. OK GNU C++17 (64) TESTS 24 93 11673600
85982617 dario2994 E July 4, 2020, 4:34 p.m. OK GNU C++17 (64) TESTS 24 93 11673600
86006561 timf1089 E July 4, 2020, 7:28 p.m. OK GNU C++17 (64) TESTS 24 93 11776000
86013003 Xylenox E July 4, 2020, 10:14 p.m. OK Go TESTS 24 187 23859200
85993045 eatmore E July 4, 2020, 5:05 p.m. OK Java 11 TESTS 24 311 23961600
86012669 RockStar_14 E July 4, 2020, 10 p.m. OK Java 11 TESTS 24 311 32256000
86002290 PizzaLovers007 E July 4, 2020, 6:20 p.m. OK Java 11 TESTS 24 326 48230400
85983040 uwi E July 4, 2020, 4:36 p.m. OK Java 11 TESTS 24 327 24166400
85998983 nirvana_rsc E July 4, 2020, 5:49 p.m. OK Java 11 TESTS 24 327 30617600
86026844 numansaleemmohd E July 5, 2020, 5:51 a.m. OK Java 11 TESTS 24 342 35840000
86010955 derrick20 E July 4, 2020, 9:06 p.m. OK Java 11 TESTS 24 358 33177600
86010194 derrick20 E July 4, 2020, 8:44 p.m. OK Java 11 TESTS 24 358 33177600
86027169 mphillotry E July 5, 2020, 5:56 a.m. OK Java 11 TESTS 24 390 36044800
85993491 Oopsimbad E July 4, 2020, 5:07 p.m. OK Java 11 TESTS 24 483 76492800
86014687 spar5h E July 4, 2020, 11:28 p.m. OK Java 8 TESTS 24 249 33484800
86008366 NatInTheHat E July 4, 2020, 8:02 p.m. OK Java 8 TESTS 24 249 33484800
86003403 prem_cse E July 4, 2020, 6:35 p.m. OK Java 8 TESTS 24 249 33587200
86016665 lucasr E July 5, 2020, 1:07 a.m. OK Java 8 TESTS 24 264 33484800
86014702 spar5h E July 4, 2020, 11:28 p.m. OK Java 8 TESTS 24 264 33484800
86011791 NatInTheHat E July 4, 2020, 9:32 p.m. OK Java 8 TESTS 24 280 25088000
85978709 DanielW48 E July 4, 2020, 4:23 p.m. OK Java 8 TESTS 24 296 52428800
86006901 robinz62 E July 4, 2020, 7:34 p.m. OK Java 8 TESTS 24 311 21196800
86014288 polyakoff E July 4, 2020, 11:09 p.m. OK Java 8 TESTS 24 311 29184000
85981194 cwise E July 4, 2020, 4:30 p.m. OK Java 8 TESTS 24 327 71270400
85965103 Tlatoani E July 4, 2020, 3:46 p.m. OK Kotlin TESTS 24 233 39731200
86013886 Hakiobo E July 4, 2020, 10:51 p.m. OK Kotlin TESTS 24 358 67072000
85983610 Hakiobo E July 4, 2020, 4:37 p.m. OK Kotlin TESTS 24 405 68198400
85991664 wp32pw E July 4, 2020, 5:02 p.m. OK MS C++ 2017 TESTS 24 327 13107200
85998457 PhongTran98 E July 4, 2020, 5:47 p.m. OK MS C++ 2017 TESTS 24 1980 19251200
85987792 pajenegod E July 4, 2020, 4:50 p.m. OK PyPy 2 TESTS 24 373 76800000
85990375 alexwice E July 4, 2020, 4:58 p.m. OK PyPy 2 TESTS 24 624 76902400
85993078 nagiss E July 4, 2020, 5:06 p.m. OK PyPy 3 TESTS 24 327 33484800
85969991 conqueror_of_tourist E July 4, 2020, 3:58 p.m. OK PyPy 3 TESTS 24 451 60518400
86007157 taoboquan1 E July 4, 2020, 7:38 p.m. OK PyPy 3 TESTS 24 451 63488000
85998829 kclee2172 E July 4, 2020, 5:48 p.m. OK PyPy 3 TESTS 24 467 62668800
85990182 __eRRor__ E July 4, 2020, 4:58 p.m. OK PyPy 3 TESTS 24 530 67276800
86019463 TheVan E July 5, 2020, 2:56 a.m. OK PyPy 3 TESTS 24 639 48640000
86012052 x3mka E July 4, 2020, 9:40 p.m. OK PyPy 3 TESTS 24 685 58880000
85990660 smart_hard E July 4, 2020, 4:59 p.m. OK PyPy 3 TESTS 24 951 67584000
85996075 gaurasha E July 4, 2020, 5:12 p.m. OK PyPy 3 TESTS 24 1185 52019200
86006669 FireBird23 E July 4, 2020, 7:30 p.m. OK PyPy 3 TESTS 24 1325 56934400
85983268 nwi E July 4, 2020, 4:36 p.m. OK Python 2 TESTS 24 873 96665600
85998733 r57shell E July 4, 2020, 5:48 p.m. OK Python 3 TESTS 24 1653 45670400
85999841 sh1194 E July 4, 2020, 5:55 p.m. OK Python 3 TESTS 24 1840 44339200
86000503 sh1194 E July 4, 2020, 6 p.m. OK Python 3 TESTS 24 1856 50892800
85999630 sh1194 E July 4, 2020, 5:53 p.m. OK Python 3 TESTS 24 1887 51097600
86000180 sh1194 E July 4, 2020, 5:57 p.m. OK Python 3 TESTS 24 1903 44236800
85999917 sh1194 E July 4, 2020, 5:55 p.m. OK Python 3 TESTS 24 1903 50892800
86000068 sh1194 E July 4, 2020, 5:57 p.m. OK Python 3 TESTS 24 1918 51712000
86013342 sansen E July 4, 2020, 10:27 p.m. OK Rust TESTS 24 109 10752000
85997401 ichyo E July 4, 2020, 5:14 p.m. OK Rust TESTS 24 155 15769600

remove filters

Back to search problems