Codeforces Round 585 (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
1215 Codeforces Round 585 (Div. 2) FINISHED False 7200 168895487 Sept. 15, 2019, 10:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11360 ) C Swap Letters PROGRAMMING constructive algorithms greedy 1500

B'Monocarp has got two strings s and t having equal length. Both strings consist of lowercase Latin letters "a" and "b". Monocarp wants to make these two strings s and t equal to each other. He can do the following operation any number of times: choose an index pos_1 in the string s , choose an index pos_2 in the string t , and swap s_{pos_1} with t_{pos_2} . You have to determine the minimum number of operations Monocarp has to perform to make s and t equal, and print any optimal sequence of operations -- or say that it is impossible to make these strings equal. The first line contains one integer n (1 <= n <= 2 cdot 10^{5}) -- the length of s and t . The second line contains one string s consisting of n characters "a" and "b". The third line contains one string t consisting of n characters "a" and "b". If it is impossible to make these strings equal, print -1 . Otherwise, in the first line print k -- the minimum number of operations required to make the strings equal. In each of the next k lines print two integers -- the index in the string s and the index in the string t that should be used in the corresponding swap operation. In the first example two operations are enough. For example, you can swap the third letter in s with the third letter in t . Then s = "abbb", t = "aaab". Then swap the third letter in s and the second letter in t . Then both s and t are equal to "abab". In the second example it 's impossible to make two strings equal. '...

Tutorials

Codeforces Round #585 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
60642673 zyenz123 C Sept. 15, 2019, 3:58 p.m. OK FPC TESTS 64 296 33177600 1500
60660284 dblark C Sept. 16, 2019, 4:12 a.m. OK FPC TESTS 64 311 1638400 1500
60625355 dblark C Sept. 15, 2019, 11:46 a.m. OK FPC TESTS 64 327 1638400 1500
60683225 Just_Matvey C Sept. 16, 2019, 2:37 p.m. OK FPC TESTS 64 327 2969600 1500
60642816 Alfeh C Sept. 15, 2019, 4:01 p.m. OK GNU C11 TESTS 64 373 2048000 1500
60648134 Luxon C Sept. 15, 2019, 5:58 p.m. OK GNU C11 TESTS 64 374 2048000 1500
61988372 Dream.to C Oct. 6, 2019, 2:18 p.m. OK GNU C11 TESTS 64 374 2048000 1500
60659198 shenlihong C Sept. 16, 2019, 3:11 a.m. OK GNU C11 TESTS 64 374 2969600 1500
62361087 abcd227 C Oct. 11, 2019, 12:30 p.m. OK GNU C11 TESTS 64 374 3584000 1500
61358568 asd4d4d4d C Sept. 27, 2019, 11:24 a.m. OK GNU C11 TESTS 64 389 409600 1500
60623207 jschr C Sept. 15, 2019, 11:35 a.m. OK GNU C11 TESTS 64 389 2048000 1500
60652242 dare_ghost C Sept. 15, 2019, 8 p.m. OK GNU C11 TESTS 64 390 2048000 1500
60626712 weastur C Sept. 15, 2019, 11:54 a.m. OK GNU C11 TESTS 64 405 409600 1500
60715612 yugao C Sept. 17, 2019, 10:29 a.m. OK GNU C11 TESTS 64 420 2048000 1500
60662177 csj C Sept. 16, 2019, 5:42 a.m. OK GNU C++11 TESTS 64 31 1945600 1500
60662095 csj C Sept. 16, 2019, 5:39 a.m. OK GNU C++11 TESTS 64 31 1945600 1500
60661843 Rachel_in C Sept. 16, 2019, 5:28 a.m. OK GNU C++11 TESTS 64 31 3584000 1500
61826537 ReaLNero1 C Oct. 4, 2019, 5 a.m. OK GNU C++11 TESTS 64 31 3584000 1500
60618170 SuperFF C Sept. 15, 2019, 11:11 a.m. OK GNU C++11 TESTS 64 31 7680000 1500
60624373 C20191629 C Sept. 15, 2019, 11:41 a.m. OK GNU C++11 TESTS 64 46 409600 1500
60656401 Youngsc C Sept. 16, 2019, 12:09 a.m. OK GNU C++11 TESTS 64 46 409600 1500
61114264 Liu_shi C Sept. 23, 2019, 12:21 p.m. OK GNU C++11 TESTS 64 46 409600 1500
60702726 TGTSTTG C Sept. 17, 2019, 2:20 a.m. OK GNU C++11 TESTS 64 46 409600 1500
60670902 3soon C Sept. 16, 2019, 10:37 a.m. OK GNU C++11 TESTS 64 46 409600 1500
61043266 wleung_bvg C Sept. 22, 2019, 2:31 a.m. OK GNU C++14 TESTS 64 31 3891200 1500
60617837 queragion2726 C Sept. 15, 2019, 11:09 a.m. OK GNU C++14 TESTS 64 46 1024000 1500
60726284 guptagovind1303 C Sept. 17, 2019, 2 p.m. OK GNU C++14 TESTS 64 46 1024000 1500
60673512 QAQmika C Sept. 16, 2019, 11:40 a.m. OK GNU C++14 TESTS 64 46 1433600 1500
60631353 hu8232 C Sept. 15, 2019, 12:21 p.m. OK GNU C++14 TESTS 64 46 1433600 1500
60621608 Ginzaner C Sept. 15, 2019, 11:26 a.m. OK GNU C++14 TESTS 64 46 1433600 1500
60664153 willingox C Sept. 16, 2019, 7 a.m. OK GNU C++14 TESTS 64 46 1433600 1500
60713725 ac_97 C Sept. 17, 2019, 9:38 a.m. OK GNU C++14 TESTS 64 46 1536000 1500
62360709 humveea6 C Oct. 11, 2019, 12:24 p.m. OK GNU C++14 TESTS 64 46 1843200 1500
60621516 Robsob C Sept. 15, 2019, 11:26 a.m. OK GNU C++14 TESTS 64 46 1843200 1500
60624119 Sea_son C Sept. 15, 2019, 11:40 a.m. OK GNU C++17 TESTS 64 46 409600 1500
61327625 Liquor2020 C Sept. 26, 2019, 2:07 p.m. OK GNU C++17 TESTS 64 46 409600 1500
66279312 bularond C Dec. 4, 2019, 4:33 p.m. OK GNU C++17 TESTS 64 46 1126400 1500
60645454 MathAmp C Sept. 15, 2019, 4:58 p.m. OK GNU C++17 TESTS 64 46 1228800 1500
60658336 Rain_conquer C Sept. 16, 2019, 2:22 a.m. OK GNU C++17 TESTS 64 46 1433600 1500
60775919 cy41 C Sept. 18, 2019, 2:22 p.m. OK GNU C++17 TESTS 64 46 1433600 1500
68073906 sunnyorrainy C Jan. 2, 2020, 11:40 a.m. OK GNU C++17 TESTS 64 46 1433600 1500
60710173 zulongfei C Sept. 17, 2019, 7:51 a.m. OK GNU C++17 TESTS 64 46 1433600 1500
60622674 binh13579113 C Sept. 15, 2019, 11:32 a.m. OK GNU C++17 TESTS 64 46 1433600 1500
60711997 Pankin C Sept. 17, 2019, 8:49 a.m. OK GNU C++17 TESTS 64 46 1536000 1500
60626971 serhiimazurok C Sept. 15, 2019, 11:55 a.m. OK Go TESTS 64 62 5324800 1500
60686271 smtcoder C Sept. 16, 2019, 3:33 p.m. OK Go TESTS 64 358 4608000 1500
68327211 warrioramrit C Jan. 6, 2020, 5:19 p.m. OK Java 11 TESTS 64 249 2355200 1500
65710236 machhra C Nov. 25, 2019, 2:05 p.m. OK Java 11 TESTS 64 249 4710400 1500
64889797 potatmen C Nov. 14, 2019, 2:20 p.m. OK Java 11 TESTS 64 264 2355200 1500
63722034 Clowyy C Oct. 29, 2019, 11:38 a.m. OK Java 11 TESTS 64 264 2355200 1500
60778413 4mda4mda C Sept. 18, 2019, 3:19 p.m. OK Java 8 TESTS 64 140 0 1500
65111901 procrastinate7 C Nov. 15, 2019, 11:30 p.m. OK Java 8 TESTS 64 140 2662400 1500
63957448 TheRaven C Nov. 1, 2019, 2:54 a.m. OK Java 8 TESTS 64 140 3788800 1500
60651182 qwerty12345qwerty C Sept. 15, 2019, 7:27 p.m. OK Java 8 TESTS 64 140 5017600 1500
61978764 insane_28 C Oct. 6, 2019, 11:20 a.m. OK Java 8 TESTS 64 140 5529600 1500
60666132 sameer_hack C Sept. 16, 2019, 8:09 a.m. OK Java 8 TESTS 64 140 7577600 1500
63952346 mbfeci C Oct. 31, 2019, 10:19 p.m. OK Java 8 TESTS 64 155 0 1500
60633662 pikapika00 C Sept. 15, 2019, 12:34 p.m. OK Java 8 TESTS 64 155 0 1500
60627422 chojh1222 C Sept. 15, 2019, 11:58 a.m. OK Java 8 TESTS 64 155 0 1500
61766065 kocko C Oct. 3, 2019, 8:39 a.m. OK Java 8 TESTS 64 155 409600 1500
60662474 sjx233 C Sept. 16, 2019, 5:55 a.m. OK JavaScript TESTS 64 529 35430400 1500
60623628 sjx233 C Sept. 15, 2019, 11:37 a.m. OK JavaScript TESTS 64 561 35430400 1500
60671593 Spheniscine C Sept. 16, 2019, 10:55 a.m. OK Kotlin TESTS 64 233 13926400 1500
60655399 Black_Fregat C Sept. 15, 2019, 10:42 p.m. OK Kotlin TESTS 64 280 12800000 1500
60630394 Denzed C Sept. 15, 2019, 12:15 p.m. OK Kotlin TESTS 64 358 18841600 1500
60622648 pavlo.liapota C Sept. 15, 2019, 11:32 a.m. OK Kotlin TESTS 64 858 1433600 1500
60625462 I_love_HellHoleStudios C Sept. 15, 2019, 11:46 a.m. OK Kotlin TESTS 64 904 819200 1500
60626313 Bobko C Sept. 15, 2019, 11:51 a.m. OK Kotlin TESTS 64 936 15872000 1500
60638704 DieAnderen C Sept. 15, 2019, 2:49 p.m. OK Kotlin TESTS 64 1465 0 1500
61841755 og.kostya C Oct. 4, 2019, 9:55 a.m. OK Mono C# TESTS 64 93 9318400 1500
60715556 treasuryonly C Sept. 17, 2019, 10:28 a.m. OK Mono C# TESTS 64 109 15769600 1500
60621636 omikad C Sept. 15, 2019, 11:27 a.m. OK Mono C# TESTS 64 124 16281600 1500
60632379 Giangvp C Sept. 15, 2019, 12:27 p.m. OK Mono C# TESTS 64 140 21504000 1500
60625591 plasma-effect C Sept. 15, 2019, 11:47 a.m. OK Mono C# TESTS 64 233 19558400 1500
60704908 nadilk C Sept. 17, 2019, 4:17 a.m. OK Mono C# TESTS 64 374 5836800 1500
60631560 hloya C Sept. 15, 2019, 12:22 p.m. OK Mono C# TESTS 64 389 9420800 1500
60676135 nadilk C Sept. 16, 2019, 12:29 p.m. OK Mono C# TESTS 64 389 10956800 1500
66497334 vjudge3 C Dec. 8, 2019, 11:05 a.m. OK MS C++ TESTS 64 46 1843200 1500
62597346 vjudge1 C Oct. 15, 2019, 2:54 a.m. OK MS C++ TESTS 64 46 1843200 1500
62595127 vjudge3 C Oct. 15, 2019, 1:03 a.m. OK MS C++ TESTS 64 46 1843200 1500
62622190 vjudge1 C Oct. 15, 2019, 1:08 p.m. OK MS C++ TESTS 64 46 2048000 1500
66497718 vjudge1 C Dec. 8, 2019, 11:14 a.m. OK MS C++ TESTS 64 46 2048000 1500
62564274 vjudge5 C Oct. 14, 2019, 12:50 p.m. OK MS C++ TESTS 64 46 2048000 1500
61950510 vjudge4 C Oct. 6, 2019, 3:06 a.m. OK MS C++ TESTS 64 46 2048000 1500
61948688 vjudge3 C Oct. 6, 2019, 2:03 a.m. OK MS C++ TESTS 64 46 2048000 1500
62621047 vjudge3 C Oct. 15, 2019, 12:51 p.m. OK MS C++ TESTS 64 46 2048000 1500
62608677 vjudge2 C Oct. 15, 2019, 8:51 a.m. OK MS C++ TESTS 64 46 2048000 1500
62597174 RONGER C Oct. 15, 2019, 2:45 a.m. OK MS C++ 2017 TESTS 64 46 1740800 1500
60622362 zzzzqq C Sept. 15, 2019, 11:30 a.m. OK MS C++ 2017 TESTS 64 46 1945600 1500
61118545 rqrqrqrqrq C Sept. 23, 2019, 1:40 p.m. OK MS C++ 2017 TESTS 64 46 2048000 1500
61842604 Laaahu_ C Oct. 4, 2019, 10:14 a.m. OK MS C++ 2017 TESTS 64 46 2048000 1500
61785072 nacl_jht C Oct. 3, 2019, 2:14 p.m. OK MS C++ 2017 TESTS 64 46 2048000 1500
60711633 swbdriviedriveme C Sept. 17, 2019, 8:38 a.m. OK MS C++ 2017 TESTS 64 46 2048000 1500
60620405 oceanlin C Sept. 15, 2019, 11:21 a.m. OK MS C++ 2017 TESTS 64 46 2048000 1500
60615519 vpike C Sept. 15, 2019, 11 a.m. OK MS C++ 2017 TESTS 64 46 2252800 1500
60639504 cjhxqdt C Sept. 15, 2019, 3:01 p.m. OK MS C++ 2017 TESTS 64 46 4403200 1500
60676353 pmitkov C Sept. 16, 2019, 12:32 p.m. OK MS C++ 2017 TESTS 64 46 4710400 1500
66638883 yumtam C Dec. 11, 2019, 1:59 p.m. OK PyPy 2 TESTS 64 186 9113600 1500
60640442 zdbtxdy C Sept. 15, 2019, 3:15 p.m. OK PyPy 2 TESTS 64 187 16691200 1500
60623574 iamprayush C Sept. 15, 2019, 11:37 a.m. OK PyPy 2 TESTS 64 218 6758400 1500
60649509 raj1307 C Sept. 15, 2019, 6:32 p.m. OK PyPy 2 TESTS 64 218 21401600 1500
60737671 shehebe C Sept. 17, 2019, 6:17 p.m. OK PyPy 2 TESTS 64 233 23859200 1500
60616715 TheManTheMythTheLegend C Sept. 15, 2019, 11:04 a.m. OK PyPy 2 TESTS 64 234 17305600 1500
60640855 anshuman16423 C Sept. 15, 2019, 3:22 p.m. OK PyPy 2 TESTS 64 670 14950400 1500
60642977 anshuman16423 C Sept. 15, 2019, 4:04 p.m. OK PyPy 2 TESTS 64 686 20992000 1500
60615631 alexwice C Sept. 15, 2019, 11 a.m. OK PyPy 2 TESTS 64 1122 6553600 1500
60627845 Ceicei C Sept. 15, 2019, noon OK PyPy 2 TESTS 64 1138 8396800 1500
60831577 Crisis98 C Sept. 19, 2019, 7:09 a.m. OK PyPy 3 TESTS 64 233 15360000 1500
60836237 Crisis98 C Sept. 19, 2019, 9:06 a.m. OK PyPy 3 TESTS 64 249 13619200 1500
63264232 alankrit_singh_1 C Oct. 23, 2019, 10:26 p.m. OK PyPy 3 TESTS 64 280 9728000 1500
60946256 Torch_bearer C Sept. 20, 2019, 7:03 p.m. OK PyPy 3 TESTS 64 295 10854400 1500
60620897 CHelle C Sept. 15, 2019, 11:23 a.m. OK PyPy 3 TESTS 64 295 11059200 1500
60655064 Rulikkk C Sept. 15, 2019, 10:20 p.m. OK PyPy 3 TESTS 64 296 11468800 1500
63017107 roman_kruger C Oct. 20, 2019, 1:14 p.m. OK PyPy 3 TESTS 64 311 10137600 1500
60640993 deadguy C Sept. 15, 2019, 3:24 p.m. OK PyPy 3 TESTS 64 311 10649600 1500
60649189 EngineerLX C Sept. 15, 2019, 6:24 p.m. OK PyPy 3 TESTS 64 311 10854400 1500
60620435 Chizhonkova C Sept. 15, 2019, 11:21 a.m. OK PyPy 3 TESTS 64 311 10956800 1500
60613091 nwi C Sept. 15, 2019, 10:51 a.m. OK Python 2 TESTS 64 390 14848000 1500
68029665 forhhgg C Jan. 1, 2020, 8:26 a.m. OK Python 2 TESTS 64 404 17408000 1500
60617585 psaini C Sept. 15, 2019, 11:08 a.m. OK Python 2 TESTS 64 405 10547200 1500
61328024 Sekirce3 C Sept. 26, 2019, 2:13 p.m. OK Python 2 TESTS 64 452 13107200 1500
60661326 w33z8kqrqk8zzzx33 C Sept. 16, 2019, 5:06 a.m. OK Python 3 TESTS 64 264 17305600 1500
61979775 Anish1712 C Oct. 6, 2019, 11:37 a.m. OK Python 3 TESTS 64 296 17305600 1500
60691942 maslov.alex1580 C Sept. 16, 2019, 5:42 p.m. OK Python 3 TESTS 64 311 10137600 1500
60618500 spellstaker C Sept. 15, 2019, 11:12 a.m. OK Python 3 TESTS 64 342 11673600 1500
60640870 LostHorizon C Sept. 15, 2019, 3:22 p.m. OK Python 3 TESTS 64 405 6656000 1500
60676661 Mariam_94 C Sept. 16, 2019, 12:38 p.m. OK Python 3 TESTS 64 436 9625600 1500
61057901 Katushechka C Sept. 22, 2019, 8:37 a.m. OK Python 3 TESTS 64 483 6860800 1500
63709377 tan_delhi C Oct. 29, 2019, 9:29 a.m. OK Python 3 TESTS 64 514 5836800 1500
60705554 NewPinC C Sept. 17, 2019, 4:50 a.m. OK Python 3 TESTS 64 514 6656000 1500
60627623 Gegege337 C Sept. 15, 2019, 11:59 a.m. OK Python 3 TESTS 64 514 6656000 1500
60622604 sansen C Sept. 15, 2019, 11:32 a.m. OK Rust TESTS 64 46 5529600 1500
60620407 yudedako C Sept. 15, 2019, 11:21 a.m. OK Scala TESTS 64 1294 0 1500

remove filters

Back to search problems