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 |
---|---|---|---|---|---|---|
1363 | Codeforces Round 646 (Div. 2) | FINISHED | False | 7200 | 140887499 | May 31, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1529 ) | F | Rotating Substrings | PROGRAMMING | dp strings | 2600 |
B'You are given two strings s and t , each of length n and consisting of lowercase Latin alphabets. You want to make s equal to t . You can perform the following operation on s any number of times to achieve it -- For example, on rotating the substring [2,4] , string "abcde" becomes "adbce". A string a is a substring of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end. Find the minimum number of operations required to convert s to t , or determine that it 's impossible. The first line of the input contains a single integer t (1 <= q t <= q 2000) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n (1 <= q n <= q 2000) -- the length of the strings. The second and the third lines contain strings s and t respectively. The sum of n over all the test cases does not exceed 2000 . For each test case, output the minimum number of operations to convert s to t . If it is not possible to convert s to t , output -1 instead. For the 1 -st test case, since s and t are equal, you don 't need to apply any operation. For the 2 -nd test case, you only need to apply one operation on the entire string ab to convert it to ba. For the 3 -rd test case, you only need to apply one operation on the entire string abc to convert it to cab. For the 4 -th test case, you need to apply the operation twice: first on the entire string abc to convert it to cab and then on the substring of length 2 beginning at the second character to convert it to cba. For the 5 -th test case, you only need to apply one operation on the entire string abab to convert it to baba. For the 6 -th test case, it '... |
78202 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
82154405 | rainboy | F | May 31, 2020, 6:58 p.m. | OK | GNU C11 | TESTS | 162 | 46 | 16486400 | 2600 | |
82244797 | minyzero | F | June 1, 2020, 5:53 p.m. | OK | GNU C++11 | TESTS | 164 | 31 | 16588800 | 2600 | |
82268755 | MR072 | F | June 2, 2020, 4:31 a.m. | OK | GNU C++11 | TESTS | 164 | 31 | 16691200 | 2600 | |
82200446 | woriazzc | F | June 1, 2020, 9:32 a.m. | OK | GNU C++11 | TESTS | 164 | 31 | 65126400 | 2600 | |
82165691 | fanache99 | F | May 31, 2020, 11:18 p.m. | OK | GNU C++11 | TESTS | 162 | 46 | 102400 | 2600 | |
82376412 | yasugongshang | F | June 3, 2020, 8:28 a.m. | OK | GNU C++11 | TESTS | 164 | 46 | 16076800 | 2600 | |
82396996 | ningyuheng | F | June 3, 2020, 12:41 p.m. | OK | GNU C++11 | TESTS | 164 | 46 | 16179200 | 2600 | |
82441937 | jiedai | F | June 4, 2020, 1:59 a.m. | OK | GNU C++11 | TESTS | 164 | 46 | 16179200 | 2600 | |
82378634 | froggyzhang | F | June 3, 2020, 8:53 a.m. | OK | GNU C++11 | TESTS | 164 | 46 | 16384000 | 2600 | |
82414582 | ACMonster | F | June 3, 2020, 3:59 p.m. | OK | GNU C++11 | TESTS | 164 | 46 | 16486400 | 2600 | |
82448007 | CaoRui2019 | F | June 4, 2020, 4:49 a.m. | OK | GNU C++11 | TESTS | 164 | 46 | 16588800 | 2600 | |
82267407 | hack191 | F | June 2, 2020, 3:59 a.m. | OK | GNU C++14 | TESTS | 164 | 46 | 307200 | 2600 | |
82226586 | ZSTU1314 | F | June 1, 2020, 2:26 p.m. | OK | GNU C++14 | TESTS | 164 | 46 | 512000 | 2600 | |
82226756 | llmxby | F | June 1, 2020, 2:28 p.m. | OK | GNU C++14 | TESTS | 164 | 46 | 512000 | 2600 | |
82146288 | BJoozz | F | May 31, 2020, 5:39 p.m. | OK | GNU C++14 | TESTS | 161 | 46 | 614400 | 2600 | |
82377311 | froggyzhang | F | June 3, 2020, 8:37 a.m. | OK | GNU C++14 | TESTS | 164 | 46 | 16384000 | 2600 | |
82152605 | jk89 | F | May 31, 2020, 6:36 p.m. | OK | GNU C++14 | TESTS | 162 | 46 | 16486400 | 2600 | |
82154249 | xb0nS | F | May 31, 2020, 6:56 p.m. | OK | GNU C++14 | TESTS | 162 | 46 | 16588800 | 2600 | |
82183773 | Rubblsh12345 | F | June 1, 2020, 6:20 a.m. | OK | GNU C++14 | TESTS | 162 | 46 | 16691200 | 2600 | |
82170081 | 6aren | F | June 1, 2020, 2:06 a.m. | OK | GNU C++14 | TESTS | 162 | 46 | 16691200 | 2600 | |
82205401 | toothbrush | F | June 1, 2020, 10:30 a.m. | OK | GNU C++14 | TESTS | 164 | 46 | 16691200 | 2600 | |
82149068 | ArshiaDadras | F | May 31, 2020, 6 p.m. | OK | GNU C++17 | TESTS | 162 | 31 | 409600 | 2600 | |
82226465 | vjudge4 | F | June 1, 2020, 2:25 p.m. | OK | GNU C++17 | TESTS | 164 | 31 | 512000 | 2600 | |
82357285 | vjudge5 | F | June 3, 2020, 3:39 a.m. | OK | GNU C++17 | TESTS | 164 | 31 | 16281600 | 2600 | |
82384243 | Kaalabaman | F | June 3, 2020, 10:05 a.m. | OK | GNU C++17 | TESTS | 164 | 46 | 102400 | 2600 | |
82467532 | Kick_IT | F | June 4, 2020, 9:22 a.m. | OK | GNU C++17 | TESTS | 164 | 46 | 204800 | 2600 | |
82153986 | ecnerwala | F | May 31, 2020, 6:52 p.m. | OK | GNU C++17 | TESTS | 162 | 46 | 307200 | 2600 | |
82376397 | Andres_Alumets | F | June 3, 2020, 8:27 a.m. | OK | GNU C++17 | TESTS | 164 | 46 | 409600 | 2600 | |
82343265 | plekkpea | F | June 2, 2020, 8:05 p.m. | OK | GNU C++17 | TESTS | 164 | 46 | 409600 | 2600 | |
82148859 | SugarDaddy | F | May 31, 2020, 5:58 p.m. | OK | GNU C++17 | TESTS | 162 | 46 | 512000 | 2600 | |
82267341 | Jarrod | F | June 2, 2020, 3:58 a.m. | OK | GNU C++17 | TESTS | 164 | 46 | 16179200 | 2600 | |
82279533 | moyan1082 | F | June 2, 2020, 7:10 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 31 | 0 | 2600 | |
82280745 | moyan1082 | F | June 2, 2020, 7:24 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 31 | 0 | 2600 | |
82259068 | StarInShadow | F | June 1, 2020, 11:22 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 31 | 0 | 2600 | |
82357316 | emengdeath | F | June 3, 2020, 3:40 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 31 | 15974400 | 2600 | |
82428471 | Anila9007 | F | June 3, 2020, 6:58 p.m. | OK | GNU C++17 (64) | TESTS | 164 | 31 | 16588800 | 2600 | |
82173543 | ILLLZKQF | F | June 1, 2020, 3:30 a.m. | OK | GNU C++17 (64) | TESTS | 162 | 31 | 16691200 | 2600 | |
82286740 | PinkRabbit | F | June 2, 2020, 8:33 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 46 | 16076800 | 2600 | |
82193780 | Cyanic | F | June 1, 2020, 8:18 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 46 | 16179200 | 2600 | |
82172536 | timf1089 | F | June 1, 2020, 3:08 a.m. | OK | GNU C++17 (64) | TESTS | 162 | 46 | 16486400 | 2600 | |
82370287 | cheissmart | F | June 3, 2020, 7:16 a.m. | OK | GNU C++17 (64) | TESTS | 164 | 46 | 16588800 | 2600 | |
82178787 | PizzaLovers007 | F | June 1, 2020, 5:14 a.m. | OK | Java 11 | TESTS | 162 | 202 | 17612800 | 2600 | |
82167356 | TheSawan | F | June 1, 2020, 12:26 a.m. | OK | Java 11 | TESTS | 162 | 218 | 18432000 | 2600 | |
82163753 | uwi | F | May 31, 2020, 9:59 p.m. | OK | Java 11 | TESTS | 162 | 233 | 0 | 2600 | |
82203060 | ELT_AW | F | June 1, 2020, 10:03 a.m. | OK | Java 11 | TESTS | 164 | 233 | 18944000 | 2600 | |
82202556 | ELT_AW | F | June 1, 2020, 9:57 a.m. | OK | Java 11 | TESTS | 164 | 249 | 18944000 | 2600 | |
82193083 | ELT_AW | F | June 1, 2020, 8:10 a.m. | OK | Java 11 | TESTS | 164 | 249 | 18944000 | 2600 | |
82214692 | Hemose | F | June 1, 2020, 12:13 p.m. | OK | Java 11 | TESTS | 164 | 265 | 18534400 | 2600 | |
82163599 | uwi | F | May 31, 2020, 9:54 p.m. | OK | Java 11 | TESTS | 162 | 265 | 18739200 | 2600 | |
82396455 | ELT_AW | F | June 3, 2020, 12:35 p.m. | OK | Java 11 | TESTS | 164 | 265 | 18944000 | 2600 | |
82163833 | Oopsimbad | F | May 31, 2020, 10:02 p.m. | OK | Java 8 | TESTS | 162 | 155 | 16793600 | 2600 | |
82380188 | Spheniscine | F | June 3, 2020, 9:14 a.m. | OK | Kotlin | TESTS | 164 | 140 | 0 | 2600 | |
82160207 | Tlatoani | F | May 31, 2020, 8:30 p.m. | OK | Kotlin | TESTS | 162 | 187 | 15974400 | 2600 | |
82171844 | avtoruxadze | F | June 1, 2020, 2:52 a.m. | OK | Mono C# | TESTS | 162 | 93 | 16384000 | 2600 | |
82334407 | pikachan14 | F | June 2, 2020, 5:42 p.m. | OK | MS C++ 2017 | TESTS | 164 | 46 | 17817600 | 2600 | |
82223825 | egneeS | F | June 1, 2020, 1:58 p.m. | OK | MS C++ 2017 | TESTS | 164 | 62 | 17817600 | 2600 | |
82166667 | lucifer1004 | F | June 1, 2020, 12:01 a.m. | OK | PyPy 3 | TESTS | 162 | 280 | 21913600 | 2600 | |
82361445 | mkawa2 | F | June 3, 2020, 5:09 a.m. | OK | PyPy 3 | TESTS | 164 | 311 | 20889600 | 2600 | |
82147001 | 1194code | F | May 31, 2020, 5:44 p.m. | OK | PyPy 3 | TESTS | 161 | 1340 | 187596800 | 2600 | |
82148018 | 1194code | F | May 31, 2020, 5:51 p.m. | OK | PyPy 3 | TESTS | 162 | 1341 | 187904000 | 2600 | |
82439237 | kobae964 | F | June 4, 2020, 12:22 a.m. | OK | Rust | TESTS | 164 | 77 | 17715200 | 2600 | |
82438806 | kobae964 | F | June 4, 2020, 12:02 a.m. | OK | Rust | TESTS | 164 | 202 | 17715200 | 2600 |
Back to search problems