Codeforces Round 547 (Div. 3)

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
1141 Codeforces Round 547 (Div. 3) FINISHED False 7200 184433087 March 19, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8624 ) D Colored Boots PROGRAMMING greedy implementation 1500

B"There are n left boots and n right boots. Each boot has a color which is denoted as a lowercase Latin letter or a question mark ('?'). Thus, you are given two strings l and r , both of length n . The character l_i stands for the color of the i -th left boot and the character r_i stands for the color of the i -th right boot. A lowercase Latin letter denotes a specific color, but the question mark ('?') denotes an indefinite color. Two specific colors are compatible if they are exactly the same. An indefinite color is compatible with any (specific or indefinite) color. For example, the following pairs of colors are compatible: ('f', 'f'), ('?', 'z'), ('a', '?') and ('?', '?'). The following pairs of colors are not compatible: ('f', 'g') and ('a', 'z'). Compute the maximum number of pairs of boots such that there is one left and one right boot in a pair and their colors are compatible. Print the maximum number of such pairs and the pairs themselves. A boot can be part of at most one pair. The first line contains n ( 1 <= n <= 150000 ), denoting the number of boots for each leg (i.e. the number of left boots and the number of right boots). The second line contains the string l of length n . It contains only lowercase Latin letters or question marks. The i -th character stands for the color of the i -th left boot. The third line contains the string r of length n . It contains only lowercase Latin letters or question marks. The i -th character stands for the color of the i -th right boot. Print k -- the maximum number of compatible left-right pairs of boots, i.e. pairs consisting of one left and one right boot which have compatible colors. The following k lines should contain pairs a_j, b_j ( 1 <= a_j, b_j <= n ). The j -th of these lines should contain the index a_j of the left boot in the j -th pair and index b_j$$"...

Tutorials

66062

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
52725772 Denor D April 14, 2019, 12:06 a.m. OK Delphi TESTS 27 92 18022400 1500
51817156 Yulia_04 D March 25, 2019, 9:55 a.m. OK FPC TESTS 27 452 35020800 1500
51923340 ddosing D March 28, 2019, 6:03 a.m. OK FPC TESTS 27 468 66355200 1500
51840703 6553368 D March 25, 2019, 9:31 p.m. OK GNU C11 TESTS 27 561 32768000 1500
54890674 _nmp_ D May 31, 2019, 8:06 p.m. OK GNU C11 TESTS 27 561 33996800 1500
56241678 cs234_shrey D June 28, 2019, 6:46 p.m. OK GNU C11 TESTS 27 561 36249600 1500
53825191 rainboy D May 6, 2019, 3:37 p.m. OK GNU C11 TESTS 27 576 33996800 1500
68737714 kaiboy D Jan. 13, 2020, 9:21 p.m. OK GNU C11 TESTS 27 577 1638400 1500
51850714 uniddr D March 26, 2019, 7:47 a.m. OK GNU C11 TESTS 27 577 33894400 1500
54890644 _nmp_ D May 31, 2019, 8:05 p.m. OK GNU C11 TESTS 27 577 33996800 1500
51978228 Romul D March 29, 2019, 3:10 p.m. OK GNU C11 TESTS 27 577 37580800 1500
60308071 vjudge5 D Sept. 9, 2019, 2:42 p.m. OK GNU C++11 TESTS 27 46 6656000 1500
60308581 swqeaaa D Sept. 9, 2019, 2:53 p.m. OK GNU C++11 TESTS 27 46 6656000 1500
64743659 vjudge5 D Nov. 12, 2019, 12:49 p.m. OK GNU C++11 TESTS 27 62 1740800 1500
52569134 AC__hunter D April 10, 2019, 1:34 p.m. OK GNU C++11 TESTS 27 62 2150400 1500
56996868 bagpipe D July 13, 2019, 11:31 p.m. OK GNU C++11 TESTS 27 62 2867200 1500
54522943 nightsunflower D May 23, 2019, 1:07 p.m. OK GNU C++11 TESTS 27 62 3379200 1500
51934988 OverloadedCode D March 28, 2019, 12:07 p.m. OK GNU C++11 TESTS 27 62 3481600 1500
53101287 PinkRabbit D April 21, 2019, 4:37 p.m. OK GNU C++11 TESTS 27 62 4608000 1500
51891530 LIKEIKE D March 27, 2019, 9:24 a.m. OK GNU C++11 TESTS 27 62 4710400 1500
52122889 vjudge5 D March 31, 2019, 4:25 p.m. OK GNU C++11 TESTS 27 62 4915200 1500
53737065 15666236 D May 4, 2019, 11:29 a.m. OK GNU C++14 TESTS 27 61 5529600 1500
51867388 Dambola D March 26, 2019, 3:48 p.m. OK GNU C++14 TESTS 27 62 2048000 1500
52512696 Rabbittank D April 9, 2019, 1:24 a.m. OK GNU C++14 TESTS 27 62 2764800 1500
52670902 vjudge4 D April 13, 2019, 7:28 a.m. OK GNU C++14 TESTS 27 62 3174400 1500
52670885 vjudge2 D April 13, 2019, 7:28 a.m. OK GNU C++14 TESTS 27 62 3174400 1500
52274283 wangshu D April 3, 2019, 2:12 p.m. OK GNU C++14 TESTS 27 62 3686400 1500
52540317 vustthat D April 9, 2019, 5:45 p.m. OK GNU C++14 TESTS 27 62 4096000 1500
52586805 Jason_YJie D April 11, 2019, 1:05 a.m. OK GNU C++14 TESTS 27 62 4812800 1500
51856859 Bill_Benation D March 26, 2019, 11:32 a.m. OK GNU C++14 TESTS 27 62 4812800 1500
52292930 MakiseVon D April 4, 2019, 3:52 a.m. OK GNU C++14 TESTS 27 62 5017600 1500
52679824 .tx D April 13, 2019, 11:45 a.m. OK GNU C++17 TESTS 27 46 6860800 1500
55295435 MishaI2004 D June 8, 2019, 9:40 a.m. OK GNU C++17 TESTS 27 46 6963200 1500
51800260 dmkozyrev D March 24, 2019, 5:36 p.m. OK GNU C++17 TESTS 27 46 6963200 1500
53321805 JiangritianQAQ D April 26, 2019, 1:16 p.m. OK GNU C++17 TESTS 27 61 2048000 1500
51925009 vjudge3 D March 28, 2019, 7:04 a.m. OK GNU C++17 TESTS 27 61 2764800 1500
53990012 Prosperity D May 11, 2019, 11:49 a.m. OK GNU C++17 TESTS 27 61 6451200 1500
52746569 doge233 D April 14, 2019, 11:58 a.m. OK GNU C++17 TESTS 27 61 6860800 1500
58694568 dmkozyrev D Aug. 13, 2019, 5:22 a.m. OK GNU C++17 TESTS 27 61 6963200 1500
61412467 airad D Sept. 28, 2019, 9:10 a.m. OK GNU C++17 TESTS 27 61 7065600 1500
53321762 JiangritianQAQ D April 26, 2019, 1:14 p.m. OK GNU C++17 TESTS 27 62 1945600 1500
55289173 efimmanevich D June 8, 2019, 6:47 a.m. OK Go TESTS 27 93 9728000 1500
67440746 sighduck D Dec. 22, 2019, 7:10 p.m. OK Go TESTS 27 249 18739200 1500
52026995 Dekedro D March 30, 2019, 3:25 p.m. OK Go TESTS 27 561 5324800 1500
52026010 Dekedro D March 30, 2019, 2:56 p.m. OK Go TESTS 27 670 18841600 1500
65486211 shsc D Nov. 21, 2019, 1:27 p.m. OK Java 11 TESTS 27 1310 8089600 1500
53147239 _hello D April 22, 2019, 3:34 p.m. OK Java 8 TESTS 27 187 6041600 1500
63271020 bleh0.5 D Oct. 24, 2019, 4:06 a.m. OK Java 8 TESTS 27 202 4812800 1500
51967571 tahasin D March 29, 2019, 10:48 a.m. OK Java 8 TESTS 27 202 9216000 1500
57615374 wisexiaoyinw D July 24, 2019, 1:10 a.m. OK Java 8 TESTS 27 202 33280000 1500
51807396 Ahmed..Adel..Selim D March 24, 2019, 11:53 p.m. OK Java 8 TESTS 27 233 4300800 1500
67013778 Ahmed_Hosssam D Dec. 16, 2019, 10:48 a.m. OK Java 8 TESTS 27 233 5734400 1500
56145448 Dejokz D June 27, 2019, 6:01 a.m. OK Java 8 TESTS 27 233 8089600 1500
56134124 Sleeperino D June 26, 2019, 8:28 p.m. OK Java 8 TESTS 27 233 8704000 1500
58108134 darren_yao D Aug. 1, 2019, 5:39 a.m. OK Java 8 TESTS 27 233 9523200 1500
63106020 Agnimandur D Oct. 22, 2019, 4:47 a.m. OK Java 8 TESTS 27 233 11776000 1500
64191088 Spheniscine D Nov. 4, 2019, 7:46 a.m. OK Kotlin TESTS 27 233 14643200 1500
56657941 Jungy D July 7, 2019, 9:05 a.m. OK Kotlin TESTS 27 296 19046400 1500
56657931 vjudge5 D July 7, 2019, 9:04 a.m. OK Kotlin TESTS 27 296 19046400 1500
55678084 og.kostya D June 17, 2019, 11:35 a.m. OK Mono C# TESTS 27 124 15974400 1500
52062869 treasuryonly D March 31, 2019, 2:59 a.m. OK Mono C# TESTS 27 171 24371200 1500
63113820 hibatibati D Oct. 22, 2019, 8:36 a.m. OK Mono C# TESTS 27 187 26214400 1500
52059829 nemars D March 30, 2019, 11:04 p.m. OK Mono C# TESTS 27 280 34713600 1500
52016481 amit1509kumar D March 30, 2019, 10:47 a.m. OK Mono C# TESTS 27 561 16179200 1500
53458710 scorpiowf D April 28, 2019, 5:37 a.m. OK MS C++ TESTS 27 62 3481600 1500
56424688 vjudge5 D July 2, 2019, 9 a.m. OK MS C++ TESTS 27 62 24473600 1500
65743372 vjudge4 D Nov. 26, 2019, 11:15 a.m. OK MS C++ TESTS 27 77 3686400 1500
52022535 vjudge4 D March 30, 2019, 1:23 p.m. OK MS C++ TESTS 27 77 4812800 1500
52450582 vjudge3 D April 7, 2019, 9:34 a.m. OK MS C++ TESTS 27 77 6348800 1500
65746123 vjudge5 D Nov. 26, 2019, 12:19 p.m. OK MS C++ TESTS 27 77 18227200 1500
54060830 vjudge1 D May 13, 2019, 11:09 a.m. OK MS C++ TESTS 27 77 18329600 1500
52676560 vjudge3 D April 13, 2019, 9:54 a.m. OK MS C++ TESTS 27 78 4812800 1500
65906611 vjudge3 D Nov. 28, 2019, 11:12 a.m. OK MS C++ TESTS 27 78 4812800 1500
53940514 vjudge3 D May 10, 2019, 2:37 a.m. OK MS C++ TESTS 27 78 4915200 1500
53876970 yp0413170331 D May 8, 2019, 12:30 p.m. OK MS C++ 2017 TESTS 27 93 5529600 1500
54167195 Kirja_ES D May 15, 2019, 9:14 a.m. OK MS C++ 2017 TESTS 27 93 11673600 1500
65742875 vjudge5 D Nov. 26, 2019, 11:03 a.m. OK MS C++ 2017 TESTS 27 109 4096000 1500
52304881 MishaSm D April 4, 2019, 11:33 a.m. OK MS C++ 2017 TESTS 27 109 6553600 1500
56586279 CtrlAlt D July 5, 2019, 4:38 p.m. OK MS C++ 2017 TESTS 27 124 6451200 1500
69055521 vjudge4 D Jan. 18, 2020, 2:20 p.m. OK MS C++ 2017 TESTS 27 140 3993600 1500
51991945 SendThemToHell D March 29, 2019, 8:46 p.m. OK MS C++ 2017 TESTS 27 202 7577600 1500
56309099 poormate D June 30, 2019, 1:44 p.m. OK MS C++ 2017 TESTS 27 218 6348800 1500
51851233 Straik D March 26, 2019, 8:06 a.m. OK MS C++ 2017 TESTS 27 218 6553600 1500
55012822 Dragostan D June 3, 2019, 10:58 a.m. OK MS C++ 2017 TESTS 27 249 20480000 1500
53845339 lostamok D May 7, 2019, 10:31 a.m. OK PHP TESTS 27 109 35225600 1500
53843196 lostamok D May 7, 2019, 8:56 a.m. OK PHP TESTS 27 608 68915200 1500
59678720 ssk497 D Aug. 29, 2019, 7:23 p.m. OK PyPy 2 TESTS 27 1700 18227200 1500
51844921 yumtam D March 26, 2019, 3:35 a.m. OK PyPy 3 TESTS 27 343 26828800 1500
51878438 toysheeyeyraku D March 26, 2019, 9:11 p.m. OK PyPy 3 TESTS 27 358 29593600 1500
52220895 acesine D April 2, 2019, 6:31 a.m. OK PyPy 3 TESTS 27 389 15360000 1500
52462417 Kirillov_Alexey D April 7, 2019, 1:59 p.m. OK PyPy 3 TESTS 27 420 13516800 1500
59623398 EngineerLX D Aug. 28, 2019, 2:58 p.m. OK PyPy 3 TESTS 27 421 14438400 1500
52074089 LordVader D March 31, 2019, 9:09 a.m. OK PyPy 3 TESTS 27 421 16793600 1500
58926150 M1T D Aug. 16, 2019, 7:37 p.m. OK PyPy 3 TESTS 27 436 14848000 1500
62318413 ashok123 D Oct. 10, 2019, 3:58 p.m. OK PyPy 3 TESTS 27 452 21401600 1500
63659921 mth1908 D Oct. 28, 2019, 1:46 p.m. OK PyPy 3 TESTS 27 467 21606400 1500
53026275 deadguy D April 19, 2019, 7:23 p.m. OK PyPy 3 TESTS 27 468 32460800 1500
53289505 TheDreamer979 D April 25, 2019, 3:07 p.m. OK Python 2 TESTS 27 686 40652800 1500
51947083 coffeeCodeCreate D March 28, 2019, 5:30 p.m. OK Python 2 TESTS 27 1122 26828800 1500
52819838 gaidash D April 16, 2019, 11:26 a.m. OK Python 3 TESTS 27 483 20992000 1500
53323588 ayejayys D April 26, 2019, 2:12 p.m. OK Python 3 TESTS 27 654 17100800 1500
51949225 Soapen D March 28, 2019, 6:53 p.m. OK Python 3 TESTS 27 670 14233600 1500
51950496 Soapen D March 28, 2019, 7:50 p.m. OK Python 3 TESTS 27 670 14848000 1500
53053954 Kjoshi D April 20, 2019, 4:10 p.m. OK Python 3 TESTS 27 686 16588800 1500
53966249 Userhandle D May 10, 2019, 5:14 p.m. OK Python 3 TESTS 27 702 16588800 1500
51994789 TheDankest D March 30, 2019, 12:18 a.m. OK Python 3 TESTS 27 780 19148800 1500
52262936 Suifengxun D April 3, 2019, 9:54 a.m. OK Python 3 TESTS 27 810 17715200 1500
59623462 EngineerLX D Aug. 28, 2019, 3 p.m. OK Python 3 TESTS 27 811 16076800 1500
54910660 Data2000 D June 1, 2019, 11 a.m. OK Python 3 TESTS 27 826 13824000 1500
61397433 sansen D Sept. 28, 2019, 3:13 a.m. OK Rust TESTS 27 62 7475200 1500
52325258 alykov D April 4, 2019, 11:37 p.m. OK Rust TESTS 27 1356 5529600 1500
52324428 alykov D April 4, 2019, 10:31 p.m. OK Rust TESTS 27 1357 4812800 1500
52325108 alykov D April 4, 2019, 11:26 p.m. OK Rust TESTS 27 1372 5632000 1500
52324812 alykov D April 4, 2019, 11:01 p.m. OK Rust TESTS 27 1372 7065600 1500
52324457 alykov D April 4, 2019, 10:32 p.m. OK Rust TESTS 27 1387 4198400 1500
52324506 alykov D April 4, 2019, 10:36 p.m. OK Rust TESTS 27 1387 4403200 1500
52325143 alykov D April 4, 2019, 11:29 p.m. OK Rust TESTS 27 1387 5222400 1500
52325132 alykov D April 4, 2019, 11:28 p.m. OK Rust TESTS 27 1388 7270400 1500
52324726 alykov D April 4, 2019, 10:54 p.m. OK Rust TESTS 27 1404 5427200 1500

remove filters

Back to search problems