Codeforces Round 599 (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
1243 Codeforces Round 599 (Div. 2) FINISHED False 7200 158770499 Nov. 6, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7111 ) B2 Character Swap (Hard Version) PROGRAMMING strings 1600

B'This problem is different from the easy version. In this version Ujan makes at most 2n swaps. In addition, k <= 1000, n <= 50 and it is necessary to print swaps themselves. You can hack this problem if you solve it. But you can hack the previous problem only if you solve both problems. After struggling and failing many times, Ujan decided to try to clean up his house again. He decided to get his strings in order first. Ujan has two distinct strings s and t of length n consisting of only of lowercase English characters. He wants to make them equal. Since Ujan is lazy, he will perform the following operation at most 2n times: he takes two positions i and j ( 1 <= i,j <= n , the values i and j can be equal or different), and swaps the characters s_i and t_j . Ujan 's goal is to make the strings s and t equal. He does not need to minimize the number of performed operations: any sequence of operations of length 2n or shorter is suitable. The first line contains a single integer k ( 1 <= q k <= q 1000 ), the number of test cases. For each of the test cases, the first line contains a single integer n ( 2 <= q n <= q 50 ), the length of the strings s and t . Each of the next two lines contains the strings s and t , each having length exactly n . The strings consist only of lowercase English letters. It is guaranteed that strings are different. For each test case, output "Yes" if Ujan can make the two strings equal with at most 2n operations and "No" otherwise. You can print each letter in any case (upper or lower). In the case of "Yes" print m ( 1 <= m <= 2n ) on the next line, where m is the number of swap operations to make the strings equal. Then print m lines, each line should contain two integers i, j ( 1 <= i, j <= n ) meaning that Ujan swaps s_i and t_j during th'...

Tutorials

Codeforces Round #599 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
67449411 ACtrain B2 Dec. 23, 2019, 2:34 a.m. OK Clang++17 Diagnostics TESTS 18 265 6348800 1600
64416484 ruban B2 Nov. 6, 2019, 5 p.m. OK Delphi TESTS 18 31 22835200 1600
64557006 LeVanThuc B2 Nov. 9, 2019, 4:20 a.m. OK FPC TESTS 18 187 5222400 1600
66279669 cdza B2 Dec. 4, 2019, 4:43 p.m. OK GNU C11 TESTS 18 171 0 1600
64429630 rainboy B2 Nov. 6, 2019, 8:39 p.m. OK GNU C11 TESTS 18 171 0 1600
64431800 jschr B2 Nov. 6, 2019, 9:46 p.m. OK GNU C11 TESTS 18 171 0 1600
64437349 kaiboy B2 Nov. 7, 2019, 2:12 a.m. OK GNU C11 TESTS 18 171 0 1600
66579433 shubh101220001 B2 Dec. 10, 2019, 8:42 a.m. OK GNU C11 TESTS 18 202 0 1600
67526992 akshatdalton B2 Dec. 24, 2019, 2:24 p.m. OK GNU C11 TESTS 18 202 0 1600
64599604 CakeMan B2 Nov. 9, 2019, 6:09 p.m. OK GNU C11 TESTS 18 202 0 1600
64705397 akash19jain B2 Nov. 11, 2019, 4:18 p.m. OK GNU C11 TESTS 18 202 0 1600
66277619 tour0149 B2 Dec. 4, 2019, 3:27 p.m. OK GNU C11 TESTS 18 202 0 1600
66277624 tour0149 B2 Dec. 4, 2019, 3:27 p.m. OK GNU C11 TESTS 18 202 0 1600
64436842 _violet B2 Nov. 7, 2019, 1:56 a.m. OK GNU C++11 TESTS 18 15 28057600 1600
64454658 lz.askey B2 Nov. 7, 2019, 8:19 a.m. OK GNU C++11 TESTS 18 30 0 1600
64473904 CondorG B2 Nov. 7, 2019, 1:50 p.m. OK GNU C++11 TESTS 18 30 0 1600
68400784 john_farmer B2 Jan. 8, 2020, 1:05 p.m. OK GNU C++11 TESTS 18 31 0 1600
68986080 dajianer B2 Jan. 17, 2020, 12:32 p.m. OK GNU C++11 TESTS 18 31 0 1600
68986125 vjudge2 B2 Jan. 17, 2020, 12:33 p.m. OK GNU C++11 TESTS 18 31 0 1600
69179885 Pyqe B2 Jan. 20, 2020, 9:39 a.m. OK GNU C++11 TESTS 18 31 0 1600
68961922 vjudge2 B2 Jan. 17, 2020, 1:49 a.m. OK GNU C++11 TESTS 18 31 0 1600
68961861 vjudge4 B2 Jan. 17, 2020, 1:45 a.m. OK GNU C++11 TESTS 18 31 0 1600
68906322 vjudge4 B2 Jan. 16, 2020, 6:52 a.m. OK GNU C++11 TESTS 18 31 0 1600
64449101 henu_16l_lxl B2 Nov. 7, 2019, 6:22 a.m. OK GNU C++14 TESTS 18 15 0 1600
64451865 Igor_2017 B2 Nov. 7, 2019, 7:22 a.m. OK GNU C++14 TESTS 18 15 0 1600
64469420 xzsunbest B2 Nov. 7, 2019, 12:40 p.m. OK GNU C++14 TESTS 18 15 0 1600
64444023 NeverCodeHungry B2 Nov. 7, 2019, 5:47 a.m. OK GNU C++14 TESTS 18 15 204800 1600
66183916 pica4500 B2 Dec. 2, 2019, 1:47 p.m. OK GNU C++14 TESTS 18 30 0 1600
65485557 vjudge1 B2 Nov. 21, 2019, 1:14 p.m. OK GNU C++14 TESTS 18 30 0 1600
65465088 _grand B2 Nov. 21, 2019, 5:24 a.m. OK GNU C++14 TESTS 18 30 0 1600
65335035 flash_7 B2 Nov. 19, 2019, 8:32 a.m. OK GNU C++14 TESTS 18 30 0 1600
64750193 Super-keybroad B2 Nov. 12, 2019, 2:57 p.m. OK GNU C++14 TESTS 18 30 0 1600
64683805 zrGB B2 Nov. 11, 2019, 11:05 a.m. OK GNU C++14 TESTS 18 30 0 1600
65164676 KKJYOvO B2 Nov. 16, 2019, 12:49 p.m. OK GNU C++17 TESTS 18 15 0 1600
65570599 vjudge5 B2 Nov. 23, 2019, 7:43 a.m. OK GNU C++17 TESTS 18 15 0 1600
65026742 Fyodor B2 Nov. 15, 2019, 8:03 a.m. OK GNU C++17 TESTS 18 15 0 1600
64727628 SandMonth B2 Nov. 12, 2019, 7:06 a.m. OK GNU C++17 TESTS 18 15 0 1600
64720511 kaike B2 Nov. 12, 2019, 3:07 a.m. OK GNU C++17 TESTS 18 15 0 1600
64649686 hltk B2 Nov. 10, 2019, 4:34 p.m. OK GNU C++17 TESTS 18 15 102400 1600
68333974 _piyush B2 Jan. 6, 2020, 8:21 p.m. OK GNU C++17 TESTS 18 15 102400 1600
64430024 Vaidik_Patel_27 B2 Nov. 6, 2019, 8:51 p.m. OK GNU C++17 TESTS 18 15 204800 1600
64790115 happy163 B2 Nov. 13, 2019, 10:50 a.m. OK GNU C++17 TESTS 18 15 204800 1600
64423129 kissu_pari_na B2 Nov. 6, 2019, 6:20 p.m. OK GNU C++17 TESTS 18 15 307200 1600
64721954 khochapak B2 Nov. 12, 2019, 4:17 a.m. OK Go TESTS 18 77 5324800 1600
64472113 maguroguma B2 Nov. 7, 2019, 1:21 p.m. OK Go TESTS 18 218 0 1600
64638644 serafimkoo B2 Nov. 10, 2019, 12:22 p.m. OK Java 11 TESTS 18 171 0 1600
65668372 findim B2 Nov. 24, 2019, 2:51 p.m. OK Java 11 TESTS 18 202 0 1600
65532333 lpls1 B2 Nov. 22, 2019, 12:54 p.m. OK Java 11 TESTS 18 202 0 1600
64422567 TheSawan B2 Nov. 6, 2019, 6:11 p.m. OK Java 11 TESTS 18 202 0 1600
65166694 Kharouba B2 Nov. 16, 2019, 1:35 p.m. OK Java 11 TESTS 18 218 0 1600
66403857 machhra B2 Dec. 6, 2019, 1:05 p.m. OK Java 11 TESTS 18 218 409600 1600
64488276 potatmen B2 Nov. 7, 2019, 6:44 p.m. OK Java 11 TESTS 18 233 0 1600
64478226 tmp_deatheye B2 Nov. 7, 2019, 3:04 p.m. OK Java 11 TESTS 18 233 0 1600
64429628 Dukkha B2 Nov. 6, 2019, 8:39 p.m. OK Java 11 TESTS 18 249 0 1600
67639794 cribabby B2 Dec. 26, 2019, 8:11 a.m. OK Java 11 TESTS 18 296 0 1600
64701210 tmp_deatheye B2 Nov. 11, 2019, 2:53 p.m. OK Java 8 TESTS 18 109 0 1600
64478255 tmp_deatheye B2 Nov. 7, 2019, 3:05 p.m. OK Java 8 TESTS 18 109 0 1600
64442613 Warbler B2 Nov. 7, 2019, 5:08 a.m. OK Java 8 TESTS 18 109 0 1600
68661410 luchy0120 B2 Jan. 12, 2020, 1:46 p.m. OK Java 8 TESTS 18 124 0 1600
67524752 vjvjain0 B2 Dec. 24, 2019, 1:38 p.m. OK Java 8 TESTS 18 124 0 1600
67400871 thisbeit B2 Dec. 22, 2019, 3:37 a.m. OK Java 8 TESTS 18 124 0 1600
67178707 O_E B2 Dec. 18, 2019, 8:51 p.m. OK Java 8 TESTS 18 124 0 1600
66771942 insane_28 B2 Dec. 13, 2019, 8:15 a.m. OK Java 8 TESTS 18 124 0 1600
65908711 kocko B2 Nov. 28, 2019, 12:04 p.m. OK Java 8 TESTS 18 124 0 1600
64862997 SpargelTarzan B2 Nov. 14, 2019, 4:27 a.m. OK Java 8 TESTS 18 124 0 1600
64487759 walborn B2 Nov. 7, 2019, 6:30 p.m. OK JavaScript TESTS 18 109 8806400 1600
64442059 Spheniscine B2 Nov. 7, 2019, 4:51 a.m. OK Kotlin TESTS 18 155 0 1600
64439067 Spheniscine B2 Nov. 7, 2019, 3:11 a.m. OK Kotlin TESTS 18 171 0 1600
64449267 Spheniscine B2 Nov. 7, 2019, 6:25 a.m. OK Kotlin TESTS 18 187 0 1600
64426244 Differum B2 Nov. 6, 2019, 7:17 p.m. OK Kotlin TESTS 18 311 2048000 1600
64471575 dev8546 B2 Nov. 7, 2019, 1:13 p.m. OK Mono C# TESTS 18 77 3072000 1600
64677952 tomomo2b2 B2 Nov. 11, 2019, 8:49 a.m. OK Mono C# TESTS 18 108 6758400 1600
65480204 ololonso B2 Nov. 21, 2019, 11:26 a.m. OK Mono C# TESTS 18 186 3072000 1600
64734151 hyzhangzhy B2 Nov. 12, 2019, 9:33 a.m. OK Mono C# TESTS 18 186 6758400 1600
64411240 artworks B2 Nov. 6, 2019, 4:44 p.m. OK Mono C# TESTS 18 186 6758400 1600
64663226 SpinDOS B2 Nov. 10, 2019, 10:50 p.m. OK Mono C# TESTS 18 187 3174400 1600
64751483 ansergeyg B2 Nov. 12, 2019, 3:23 p.m. OK Mono C# TESTS 18 217 3072000 1600
64564477 nastya1199 B2 Nov. 9, 2019, 7:13 a.m. OK Mono C# TESTS 18 218 6758400 1600
64504022 toraoh B2 Nov. 8, 2019, 5:58 a.m. OK Mono C# TESTS 18 233 3072000 1600
65169685 vjudge1 B2 Nov. 16, 2019, 2:37 p.m. OK MS C++ TESTS 18 31 0 1600
68915490 vjudge4 B2 Jan. 16, 2020, 8:25 a.m. OK MS C++ TESTS 18 31 0 1600
66088119 vjudge5 B2 Dec. 1, 2019, 6:03 a.m. OK MS C++ TESTS 18 31 0 1600
65998238 vjudge1 B2 Nov. 29, 2019, 6:13 p.m. OK MS C++ TESTS 18 31 0 1600
65920669 vjudge3 B2 Nov. 28, 2019, 4:14 p.m. OK MS C++ TESTS 18 31 0 1600
65022812 vjudge5 B2 Nov. 15, 2019, 6:09 a.m. OK MS C++ TESTS 18 31 0 1600
64529140 vjudge5 B2 Nov. 8, 2019, 2:47 p.m. OK MS C++ TESTS 18 31 0 1600
64499780 seh631638554 B2 Nov. 8, 2019, 3:22 a.m. OK MS C++ TESTS 18 31 0 1600
66012807 vjudge4 B2 Nov. 30, 2019, 3:40 a.m. OK MS C++ TESTS 18 46 0 1600
65563579 vjudge1 B2 Nov. 23, 2019, 4:40 a.m. OK MS C++ TESTS 18 46 204800 1600
64471547 vjudge5 B2 Nov. 7, 2019, 1:13 p.m. OK MS C++ 2017 TESTS 18 31 0 1600
65570568 vjudge5 B2 Nov. 23, 2019, 7:42 a.m. OK MS C++ 2017 TESTS 18 31 0 1600
64465986 2018030402032 B2 Nov. 7, 2019, 11:45 a.m. OK MS C++ 2017 TESTS 18 31 0 1600
64438807 return-zan B2 Nov. 7, 2019, 3:01 a.m. OK MS C++ 2017 TESTS 18 31 0 1600
64439334 P___ B2 Nov. 7, 2019, 3:21 a.m. OK MS C++ 2017 TESTS 18 31 0 1600
64407934 Ivan11 B2 Nov. 6, 2019, 4:33 p.m. OK MS C++ 2017 TESTS 18 46 0 1600
64427271 darkest358 B2 Nov. 6, 2019, 7:40 p.m. OK MS C++ 2017 TESTS 18 46 0 1600
65998210 mckm2000 B2 Nov. 29, 2019, 6:13 p.m. OK MS C++ 2017 TESTS 18 46 0 1600
64641907 ___-____- B2 Nov. 10, 2019, 1:29 p.m. OK MS C++ 2017 TESTS 18 46 10035200 1600
64414222 travelbeeee.tistory B2 Nov. 6, 2019, 4:54 p.m. OK MS C++ 2017 TESTS 18 62 0 1600
64432535 evgeny.poloznov B2 Nov. 6, 2019, 10:18 p.m. OK PHP TESTS 18 217 409600 1600
66774333 yumtam B2 Dec. 13, 2019, 9:18 a.m. OK PyPy 2 TESTS 18 233 6553600 1600
64459375 iamprayush B2 Nov. 7, 2019, 9:47 a.m. OK PyPy 2 TESTS 18 264 5734400 1600
64421985 zaceleiseliakai B2 Nov. 6, 2019, 6:03 p.m. OK PyPy 2 TESTS 18 452 5120000 1600
66074529 xiaowuc1 B2 Nov. 30, 2019, 9:54 p.m. OK PyPy 2 TESTS 18 701 6144000 1600
64429845 raj1307 B2 Nov. 6, 2019, 8:45 p.m. OK PyPy 3 TESTS 18 233 7884800 1600
64444950 Akash_123 B2 Nov. 7, 2019, 6:10 a.m. OK PyPy 3 TESTS 18 249 9318400 1600
64430217 IKnoom B2 Nov. 6, 2019, 8:56 p.m. OK PyPy 3 TESTS 18 249 9318400 1600
64430245 IKnoom B2 Nov. 6, 2019, 8:57 p.m. OK PyPy 3 TESTS 18 264 9318400 1600
65281359 satyamcse B2 Nov. 18, 2019, 5:55 a.m. OK PyPy 3 TESTS 18 295 9318400 1600
64533272 codershuvo B2 Nov. 8, 2019, 4:08 p.m. OK PyPy 3 TESTS 18 295 9625600 1600
64498410 FlyingBag65 B2 Nov. 8, 2019, 2:15 a.m. OK PyPy 3 TESTS 18 295 9625600 1600
64494457 fzanutto B2 Nov. 7, 2019, 10:16 p.m. OK PyPy 3 TESTS 18 296 9728000 1600
64422073 rmyak B2 Nov. 6, 2019, 6:04 p.m. OK PyPy 3 TESTS 18 296 10342400 1600
64422663 ngsm B2 Nov. 6, 2019, 6:13 p.m. OK PyPy 3 TESTS 18 311 9523200 1600
64426375 fippo B2 Nov. 6, 2019, 7:20 p.m. OK Python 2 TESTS 18 296 102400 1600
64439930 aaa_bbb_ccc B2 Nov. 7, 2019, 3:41 a.m. OK Python 2 TESTS 18 327 102400 1600
64742426 zdbtxdy B2 Nov. 12, 2019, 12:25 p.m. OK Python 2 TESTS 18 343 102400 1600
67563941 Gigachad69 B2 Dec. 24, 2019, 6:30 p.m. OK Python 3 TESTS 18 233 307200 1600
64766963 Alastarr B2 Nov. 12, 2019, 9:07 p.m. OK Python 3 TESTS 18 280 2662400 1600
66870372 sritha B2 Dec. 14, 2019, 1:26 p.m. OK Python 3 TESTS 18 295 204800 1600
64429985 3x7 B2 Nov. 6, 2019, 8:49 p.m. OK Python 3 TESTS 18 296 512000 1600
64433294 luismriq B2 Nov. 6, 2019, 11:01 p.m. OK Python 3 TESTS 18 311 204800 1600
64416309 Gaurav1 B2 Nov. 6, 2019, 5 p.m. OK Python 3 TESTS 18 311 1228800 1600
64766297 Alastarr B2 Nov. 12, 2019, 8:49 p.m. OK Python 3 TESTS 18 327 2662400 1600
64755799 heurezjusz B2 Nov. 12, 2019, 4:52 p.m. OK Python 3 TESTS 18 374 716800 1600
64407200 runnie B2 Nov. 6, 2019, 4:30 p.m. OK Python 3 TESTS 18 389 307200 1600
64658566 JK47 B2 Nov. 10, 2019, 8:04 p.m. OK Python 3 TESTS 18 390 307200 1600
64425339 super_hook_girl_lover B2 Nov. 6, 2019, 7:01 p.m. OK Ruby TESTS 18 452 409600 1600
66223013 yuya178 B2 Dec. 3, 2019, 11:30 a.m. OK Rust TESTS 18 436 204800 1600
64501460 AlexProk B2 Nov. 8, 2019, 4:29 a.m. OK Scala TESTS 18 639 204800 1600

remove filters

Back to search problems