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 |
---|---|---|---|---|---|---|
1370 | Codeforces Round 651 (Div. 2) | FINISHED | False | 8100 | 144602663 | June 20, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4946 ) | E | Binary Subsequence Rotation | PROGRAMMING | binary search data structures dp greedy implementation |
B'Naman has two binary strings s and t of length n (a binary string is a string which only consists of the characters "0" and "1"). He wants to convert s into t using the following operation as few times as possible. In one operation, he can choose any subsequence of s and rotate it clockwise once. For example, if s = 1 textbf{1}101 textbf{00} , he can choose a subsequence corresponding to indices ( 1 -based) {2, 6, 7 } and rotate them clockwise. The resulting string would then be s = 1 textbf{0}101 textbf{10} . A string a is said to be a subsequence of string b if a can be obtained from b by deleting some characters without changing the ordering of the remaining characters. To perform a clockwise rotation on a sequence c of size k is to perform an operation which sets c_1:=c_k, c_2:=c_1, c_3:=c_2, ldots, c_k:=c_{k-1} simultaneously. Determine the minimum number of operations Naman has to perform to convert s into t or say that it is impossible. The first line contains a single integer n (1 <= n <= 10^6) -- the length of the strings. The second line contains the binary string s of length n . The third line contains the binary string t of length n . If it is impossible to convert s to t after any number of operations, print -1 . Otherwise, print the minimum number of operations required. In the first test, Naman can choose the subsequence corresponding to indices {2, 6 } and rotate it once to convert s into t . In the second test, he can rotate the subsequence corresponding to all indices 5 times. It can be proved, that it is the minimum required number of operations. In the last test, it is impossible to convert s into t . '... |
Editorial — Codeforces Round #651 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
84511387 | cedretaber | E | June 20, 2020, 4:48 p.m. | OK | D | TESTS | 88 | 62 | 4198400 | ||
84503904 | Gassa | E | June 20, 2020, 4:34 p.m. | OK | D | TESTS | 88 | 109 | 6144000 | ||
84478531 | rainboy | E | June 20, 2020, 3:44 p.m. | OK | GNU C11 | TESTS | 88 | 46 | 2252800 | ||
84542267 | hunxuewangzi | E | June 21, 2020, 2:59 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84540719 | Cai_GVZ_Cai | E | June 21, 2020, 2:16 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84540264 | Flyzz | E | June 21, 2020, 2:02 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84522405 | srijon51 | E | June 20, 2020, 6:58 p.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84516009 | Hoshimi | E | June 20, 2020, 6:07 p.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84493218 | cjtsear | E | June 20, 2020, 4:11 p.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84482655 | andrey.starodubtsev | E | June 20, 2020, 3:51 p.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84543022 | xilinshancun101 | E | June 21, 2020, 3:18 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84542695 | AFRG | E | June 21, 2020, 3:10 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84542313 | tanxi | E | June 21, 2020, 3 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 2048000 | ||
84487385 | houguanli | E | June 20, 2020, 4 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 2048000 | ||
84481052 | Blue233333Weak | E | June 20, 2020, 3:48 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 2048000 | ||
84504843 | pengpengca | E | June 20, 2020, 4:36 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 2048000 | ||
84532785 | napgod_pk | E | June 20, 2020, 9:42 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84519535 | B-N-B | E | June 20, 2020, 6:30 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84515701 | kal013 | E | June 20, 2020, 6:06 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84515301 | linesekarenge | E | June 20, 2020, 6:05 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84509287 | Blade-Master | E | June 20, 2020, 4:44 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84508062 | spark_in | E | June 20, 2020, 4:42 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84524715 | temporaryD | E | June 20, 2020, 7:27 p.m. | OK | GNU C++14 | TESTS | 88 | 46 | 3481600 | ||
84517898 | MridulHaque | E | June 20, 2020, 6:18 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2048000 | ||
84542485 | Yzm007 | E | June 21, 2020, 3:05 a.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2048000 | ||
84505678 | dung11112003 | E | June 20, 2020, 4:37 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2252800 | ||
84541195 | Hugin | E | June 21, 2020, 2:30 a.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2252800 | ||
84528615 | badcw | E | June 20, 2020, 8:22 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2252800 | ||
84491473 | Life_chicken | E | June 20, 2020, 4:08 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2252800 | ||
84483051 | Doncic | E | June 20, 2020, 3:52 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2252800 | ||
84475533 | unknown_OvO | E | June 20, 2020, 3:39 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 2252800 | ||
84501216 | mengls66 | E | June 20, 2020, 4:28 p.m. | OK | GNU C++17 | TESTS | 88 | 46 | 3276800 | ||
84544220 | Kognition | E | June 21, 2020, 3:44 a.m. | OK | GNU C++17 | TESTS | 88 | 46 | 3481600 | ||
84539617 | tyler | E | June 21, 2020, 1:40 a.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84537428 | kaiboy | E | June 21, 2020, 12:17 a.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84535593 | kejriwalawadh | E | June 20, 2020, 11:01 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84533216 | RitikBaid | E | June 20, 2020, 9:52 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84532194 | errorgorn | E | June 20, 2020, 9:29 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84531478 | jainbot27 | E | June 20, 2020, 9:13 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84527680 | chunjie | E | June 20, 2020, 8:08 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84518168 | Valera_Grinenko | E | June 20, 2020, 6:20 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84517664 | aditya_sheth | E | June 20, 2020, 6:16 p.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84540220 | i_am_noob | E | June 21, 2020, 2:01 a.m. | OK | GNU C++17 (64) | TESTS | 88 | 46 | 4505600 | ||
84539354 | Thallium_is_Vegetable | E | June 21, 2020, 1:30 a.m. | OK | Go | TESTS | 88 | 77 | 13004800 | ||
84519465 | wistful23 | E | June 20, 2020, 6:30 p.m. | OK | Java 11 | TESTS | 88 | 187 | 0 | ||
84477530 | Hemose | E | June 20, 2020, 3:42 p.m. | OK | Java 11 | TESTS | 88 | 202 | 0 | ||
84532884 | skittles1412 | E | June 20, 2020, 9:44 p.m. | OK | Java 11 | TESTS | 88 | 218 | 0 | ||
84531447 | TheSawan | E | June 20, 2020, 9:12 p.m. | OK | Java 11 | TESTS | 88 | 218 | 0 | ||
84528092 | nthistle | E | June 20, 2020, 8:14 p.m. | OK | Java 11 | TESTS | 88 | 218 | 0 | ||
84490388 | awesomelemonade | E | June 20, 2020, 4:05 p.m. | OK | Java 11 | TESTS | 88 | 218 | 0 | ||
84507364 | wistful23 | E | June 20, 2020, 4:41 p.m. | OK | Java 11 | TESTS | 88 | 218 | 4300800 | ||
84518313 | chris_11 | E | June 20, 2020, 6:21 p.m. | OK | Java 11 | TESTS | 88 | 218 | 4608000 | ||
84489238 | Giantpizzahead | E | June 20, 2020, 4:03 p.m. | OK | Java 11 | TESTS | 88 | 233 | 0 | ||
84531966 | derrick20 | E | June 20, 2020, 9:23 p.m. | OK | Java 11 | TESTS | 88 | 233 | 2355200 | ||
84515908 | MohamedK | E | June 20, 2020, 6:07 p.m. | OK | Java 8 | TESTS | 88 | 140 | 6041600 | ||
84519474 | 1u_my_light | E | June 20, 2020, 6:30 p.m. | OK | Java 8 | TESTS | 88 | 155 | 2867200 | ||
84506757 | xwchen | E | June 20, 2020, 4:40 p.m. | OK | Java 8 | TESTS | 88 | 155 | 2867200 | ||
84476629 | Whiplash99 | E | June 20, 2020, 3:41 p.m. | OK | Java 8 | TESTS | 88 | 155 | 2867200 | ||
84493222 | polyakoff | E | June 20, 2020, 4:11 p.m. | OK | Java 8 | TESTS | 88 | 156 | 6041600 | ||
84507150 | KharYusuf | E | June 20, 2020, 4:40 p.m. | OK | Java 8 | TESTS | 88 | 170 | 2355200 | ||
84511150 | Charlesna | E | June 20, 2020, 4:47 p.m. | OK | Java 8 | TESTS | 88 | 186 | 2560000 | ||
84487399 | robinz62 | E | June 20, 2020, 4 p.m. | OK | Java 8 | TESTS | 88 | 264 | 35532800 | ||
84495556 | YahiaSherif | E | June 20, 2020, 4:16 p.m. | OK | Java 8 | TESTS | 88 | 265 | 8499200 | ||
84506249 | barakraganosungam | E | June 20, 2020, 4:39 p.m. | OK | Java 8 | TESTS | 88 | 296 | 43110400 | ||
84540150 | Hakiobo | E | June 21, 2020, 1:59 a.m. | OK | Kotlin | TESTS | 88 | 140 | 3686400 | ||
84533641 | Hakiobo | E | June 20, 2020, 10:02 p.m. | OK | Kotlin | TESTS | 88 | 156 | 3686400 | ||
84491414 | elizarov | E | June 20, 2020, 4:07 p.m. | OK | Kotlin | TESTS | 88 | 280 | 7270400 | ||
84500251 | devil_within | E | June 20, 2020, 4:26 p.m. | OK | Kotlin | TESTS | 88 | 1091 | 66355200 | ||
84527766 | mban259 | E | June 20, 2020, 8:09 p.m. | OK | Mono C# | TESTS | 88 | 124 | 15872000 | ||
84499468 | r57shell | E | June 20, 2020, 4:24 p.m. | OK | MS C++ | TESTS | 88 | 46 | 6041600 | ||
84488044 | machine_solution | E | June 20, 2020, 4:01 p.m. | OK | MS C++ 2017 | TESTS | 88 | 61 | 12083200 | ||
84522246 | xsc | E | June 20, 2020, 6:56 p.m. | OK | MS C++ 2017 | TESTS | 88 | 62 | 2355200 | ||
84492647 | youx | E | June 20, 2020, 4:10 p.m. | OK | MS C++ 2017 | TESTS | 88 | 62 | 3276800 | ||
84488227 | P___ | E | June 20, 2020, 4:01 p.m. | OK | MS C++ 2017 | TESTS | 88 | 62 | 4403200 | ||
84496897 | 4eT_llpuyHblJl | E | June 20, 2020, 4:19 p.m. | OK | MS C++ 2017 | TESTS | 88 | 62 | 5836800 | ||
84497809 | tarattata1 | E | June 20, 2020, 4:21 p.m. | OK | MS C++ 2017 | TESTS | 88 | 62 | 9420800 | ||
84489516 | nikita1998 | E | June 20, 2020, 4:04 p.m. | OK | MS C++ 2017 | TESTS | 88 | 62 | 19865600 | ||
84501737 | Miris | E | June 20, 2020, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 88 | 389 | 34508800 | ||
84523230 | reikiriyama | E | June 20, 2020, 7:08 p.m. | OK | MS C++ 2017 | TESTS | 88 | 389 | 34611200 | ||
84516127 | klond90 | E | June 20, 2020, 6:07 p.m. | OK | Node.js | TESTS | 88 | 171 | 36454400 | ||
84523289 | shehebe | E | June 20, 2020, 7:08 p.m. | OK | PyPy 2 | TESTS | 88 | 187 | 14438400 | ||
84518929 | wolffd | E | June 20, 2020, 6:25 p.m. | OK | PyPy 2 | TESTS | 88 | 217 | 7884800 | ||
84489594 | pajenegod | E | June 20, 2020, 4:04 p.m. | OK | PyPy 2 | TESTS | 88 | 358 | 24064000 | ||
84510568 | taoboquan1 | E | June 20, 2020, 4:46 p.m. | OK | PyPy 3 | TESTS | 88 | 295 | 9932800 | ||
84486117 | kclee2172 | E | June 20, 2020, 3:57 p.m. | OK | PyPy 3 | TESTS | 88 | 295 | 10137600 | ||
84521978 | nehan_der_thal | E | June 20, 2020, 6:53 p.m. | OK | PyPy 3 | TESTS | 88 | 296 | 9932800 | ||
84531537 | khyati12 | E | June 20, 2020, 9:14 p.m. | OK | PyPy 3 | TESTS | 88 | 296 | 10137600 | ||
84511385 | zii.hrs | E | June 20, 2020, 4:48 p.m. | OK | PyPy 3 | TESTS | 88 | 311 | 15052800 | ||
84536096 | x3mka | E | June 20, 2020, 11:20 p.m. | OK | PyPy 3 | TESTS | 88 | 326 | 10240000 | ||
84517754 | Sinstrio | E | June 20, 2020, 6:17 p.m. | OK | PyPy 3 | TESTS | 88 | 326 | 16588800 | ||
84515903 | titia | E | June 20, 2020, 6:07 p.m. | OK | PyPy 3 | TESTS | 88 | 327 | 9728000 | ||
84495288 | MarekW123 | E | June 20, 2020, 4:15 p.m. | OK | PyPy 3 | TESTS | 88 | 327 | 10240000 | ||
84520075 | maxwill | E | June 20, 2020, 6:35 p.m. | OK | PyPy 3 | TESTS | 88 | 342 | 10035200 | ||
84527480 | ap1008 | E | June 20, 2020, 8:05 p.m. | OK | Python 2 | TESTS | 88 | 1482 | 22425600 | ||
84535525 | alon276 | E | June 20, 2020, 10:58 p.m. | OK | Python 3 | TESTS | 88 | 451 | 4812800 | ||
84544051 | clanmember | E | June 21, 2020, 3:40 a.m. | OK | Python 3 | TESTS | 88 | 655 | 4300800 | ||
84493768 | black_rabbit | E | June 20, 2020, 4:12 p.m. | OK | Python 3 | TESTS | 88 | 795 | 14131200 | ||
84519431 | sh1194 | E | June 20, 2020, 6:29 p.m. | OK | Python 3 | TESTS | 88 | 826 | 14028800 | ||
84519632 | sh1194 | E | June 20, 2020, 6:31 p.m. | OK | Python 3 | TESTS | 88 | 842 | 14131200 | ||
84519544 | sh1194 | E | June 20, 2020, 6:30 p.m. | OK | Python 3 | TESTS | 88 | 873 | 14336000 | ||
84509285 | hardikdua | E | June 20, 2020, 4:44 p.m. | OK | Python 3 | TESTS | 88 | 1185 | 20787200 | ||
84507792 | GeoffreyY | E | June 20, 2020, 4:42 p.m. | OK | Rust | TESTS | 88 | 46 | 4812800 | ||
84496708 | fatemender | E | June 20, 2020, 4:18 p.m. | OK | Rust | TESTS | 88 | 46 | 12185600 | ||
84502460 | robostac | E | June 20, 2020, 4:31 p.m. | OK | Rust | TESTS | 88 | 78 | 8499200 |
Back to search problems