Codeforces Round 582 (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
1213 Codeforces Round 582 (Div. 3) FINISHED False 7200 170004263 Aug. 30, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2644 ) F Unstable String Sort PROGRAMMING data structures dfs and similar ds graphs greedy implementation strings 2400

B'Authors have come up with the string s consisting of n lowercase Latin letters. You are given two permutations of its indices (not necessary equal) p and q (both of length n ). Recall that the permutation is the array of length n which contains each integer from 1 to n exactly once. For all i from 1 to n-1 the following properties hold: s[p_i] <= s[p_{i + 1}] and s[q_i] <= s[q_{i + 1}] . It means that if you will write down all characters of s in order of permutation indices, the resulting string will be sorted in the non-decreasing order. Your task is to restore any such string s of length n consisting of at least k distinct lowercase Latin letters which suits the given permutations. If there are multiple answers, you can print any of them. The first line of the input contains two integers n and k ( 1 <= n <= 2 cdot 10^5, 1 <= k <= 26 ) -- the length of the string and the number of distinct characters required. The second line of the input contains n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n , all p_i are distinct integers from 1 to n ) -- the permutation p . The third line of the input contains n integers q_1, q_2, ... , q_n ( 1 <= q_i <= n , all q_i are distinct integers from 1 to n ) -- the permutation q . If it is impossible to find the suitable string, print "NO" on the first line. Otherwise print "YES" on the first line and string s on the second line. It should consist of n lowercase Latin letters, contain at least k distinct characters and suit the given permutations. If there are multiple answers, you can print any of them. '...

Tutorials

Codeforces Round #582 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
64071337 JoneySun F Nov. 2, 2019, 7:29 a.m. OK Clang++17 Diagnostics TESTS 66 233 2867200 2400
61899362 _Teemo F Oct. 5, 2019, 8:10 a.m. OK GNU C++11 TESTS 66 46 2457600 2400
66670880 vjudge3 F Dec. 12, 2019, 9:16 a.m. OK GNU C++11 TESTS 66 46 2662400 2400
66670857 Contna F Dec. 12, 2019, 9:15 a.m. OK GNU C++11 TESTS 66 46 2662400 2400
63217173 NoteTwilight F Oct. 23, 2019, 6:32 a.m. OK GNU C++11 TESTS 66 46 3788800 2400
62241556 luogu_bot5 F Oct. 10, 2019, 1:59 a.m. OK GNU C++11 TESTS 66 46 3891200 2400
62247590 lzjsy F Oct. 10, 2019, 7:24 a.m. OK GNU C++11 TESTS 66 46 3993600 2400
60349436 wasa855 F Sept. 10, 2019, 1:45 p.m. OK GNU C++11 TESTS 66 46 3993600 2400
60289252 hz2016 F Sept. 9, 2019, 5:54 a.m. OK GNU C++11 TESTS 66 46 3993600 2400
68346137 youngsystem F Jan. 7, 2020, 7:21 a.m. OK GNU C++11 TESTS 66 46 4198400 2400
64370038 Dream-chasing_Juvenile F Nov. 6, 2019, 2:03 p.m. OK GNU C++11 TESTS 66 46 4198400 2400
60290361 9lie F Sept. 9, 2019, 6:46 a.m. OK GNU C++14 TESTS 66 109 1638400 2400
60770382 daminisherathiya F Sept. 18, 2019, 12:29 p.m. OK GNU C++14 TESTS 66 109 1843200 2400
60269841 jell F Sept. 8, 2019, 2:58 p.m. OK GNU C++14 TESTS 66 109 2355200 2400
60937167 tanmay2625 F Sept. 20, 2019, 3:45 p.m. OK GNU C++14 TESTS 66 109 3686400 2400
59968137 krijgertje F Sept. 3, 2019, 10:07 p.m. OK GNU C++14 TESTS 66 109 3788800 2400
60193000 bigdekopon F Sept. 6, 2019, 10:55 p.m. OK GNU C++14 TESTS 66 109 4812800 2400
59865795 codename27 F Sept. 1, 2019, 5:07 p.m. OK GNU C++14 TESTS 66 109 5017600 2400
59955464 ccsu_cat_love_jiejie F Sept. 3, 2019, 4 p.m. OK GNU C++14 TESTS 66 109 5836800 2400
59883525 namanbansal013 F Sept. 2, 2019, 6:35 a.m. OK GNU C++14 TESTS 66 109 13004800 2400
59866426 HsiaoE F Sept. 1, 2019, 5:22 p.m. OK GNU C++14 TESTS 66 124 1843200 2400
59849265 HorizonWind F Sept. 1, 2019, 10:48 a.m. OK GNU C++17 TESTS 66 62 62464000 2400
59846904 yeh97xyz F Sept. 1, 2019, 9:52 a.m. OK GNU C++17 TESTS 66 93 3174400 2400
63981504 vjudge5 F Nov. 1, 2019, 10:28 a.m. OK GNU C++17 TESTS 66 108 3993600 2400
61438191 rushipatel11111 F Sept. 28, 2019, 5:32 p.m. OK GNU C++17 TESTS 66 109 1843200 2400
60714412 QYitong1 F Sept. 17, 2019, 9:53 a.m. OK GNU C++17 TESTS 66 109 2048000 2400
60073294 nhanlun F Sept. 5, 2019, 11:50 a.m. OK GNU C++17 TESTS 66 109 3686400 2400
59902900 Mark_Louba F Sept. 2, 2019, 2:16 p.m. OK GNU C++17 TESTS 66 109 3993600 2400
61098643 lys013 F Sept. 23, 2019, 5:22 a.m. OK GNU C++17 TESTS 66 109 4096000 2400
59933202 K0u1e F Sept. 3, 2019, 8:17 a.m. OK GNU C++17 TESTS 66 124 1740800 2400
60754930 Tigutor F Sept. 18, 2019, 8:21 a.m. OK GNU C++17 TESTS 66 124 1843200 2400
59936462 xodiac F Sept. 3, 2019, 9:40 a.m. OK Java 8 TESTS 66 202 4812800 2400
59834199 yaoct F Sept. 1, 2019, 2:34 a.m. OK Java 8 TESTS 66 202 6656000 2400
59829071 icpc_loser F Aug. 31, 2019, 9:16 p.m. OK Java 8 TESTS 66 217 8601600 2400
59889525 In_The_Name_Of_Love F Sept. 2, 2019, 9:44 a.m. OK Java 8 TESTS 66 218 4710400 2400
59920699 Jarik F Sept. 2, 2019, 10:26 p.m. OK Java 8 TESTS 66 374 44851200 2400
66159484 dalt F Dec. 2, 2019, 2:58 a.m. OK Java 8 TESTS 66 404 56729600 2400
60194561 Suzukaze F Sept. 7, 2019, 12:28 a.m. OK Java 8 TESTS 66 654 3379200 2400
65347476 AhmedSoliman F Nov. 19, 2019, 1:05 p.m. OK Java 8 TESTS 66 670 174080000 2400
59831118 SpargelTarzan F Aug. 31, 2019, 11:06 p.m. OK Java 8 TESTS 66 826 6656000 2400
61340859 hyperpolyglot F Sept. 26, 2019, 9:04 p.m. OK Java 8 TESTS 66 1138 91750400 2400
59926093 Spheniscine F Sept. 3, 2019, 4:08 a.m. OK Kotlin TESTS 66 280 22323200 2400
62250436 vjudge3 F Oct. 10, 2019, 9:06 a.m. OK MS C++ TESTS 66 93 3379200 2400
61454813 vjudge2 F Sept. 29, 2019, 5:41 a.m. OK MS C++ TESTS 66 93 4198400 2400
61533575 vjudge2 F Sept. 30, 2019, 5 a.m. OK MS C++ TESTS 66 93 13824000 2400
60306248 vjudge1 F Sept. 9, 2019, 1:59 p.m. OK MS C++ TESTS 66 109 3993600 2400
61461305 vjudge4 F Sept. 29, 2019, 8:40 a.m. OK MS C++ TESTS 66 109 13824000 2400
61460733 vjudge3 F Sept. 29, 2019, 8:26 a.m. OK MS C++ TESTS 66 124 16998400 2400
61455847 vjudge2 F Sept. 29, 2019, 6:12 a.m. OK MS C++ TESTS 66 156 3276800 2400
60240606 j2v F Sept. 7, 2019, 9:02 p.m. OK MS C++ 2017 TESTS 66 171 7475200 2400
60240529 j2v F Sept. 7, 2019, 8:58 p.m. OK MS C++ 2017 TESTS 66 280 5939200 2400
59891476 Arcadii F Sept. 2, 2019, 10:34 a.m. OK MS C++ 2017 TESTS 66 358 3993600 2400
59875089 WoodMachine F Sept. 1, 2019, 10:27 p.m. OK MS C++ 2017 TESTS 66 358 13107200 2400
64475880 vjudge5 F Nov. 7, 2019, 2:22 p.m. OK MS C++ 2017 TESTS 66 358 42496000 2400
68878292 SendThemToHell F Jan. 15, 2020, 5:44 p.m. OK MS C++ 2017 TESTS 66 467 18124800 2400
60044011 Sanqer F Sept. 4, 2019, 7:31 p.m. OK MS C++ 2017 TESTS 66 498 20172800 2400
61166111 heartsker F Sept. 23, 2019, 4:08 p.m. OK MS C++ 2017 TESTS 66 530 20480000 2400
60349307 Ancient_mage F Sept. 10, 2019, 1:43 p.m. OK MS C++ 2017 TESTS 66 546 16998400 2400
59935921 CrashMaster F Sept. 3, 2019, 9:28 a.m. OK MS C++ 2017 TESTS 66 577 5939200 2400
64121860 eightants F Nov. 3, 2019, 1:59 a.m. OK PyPy 2 TESTS 66 795 69632000 2400
59971728 Black_Fregat F Sept. 4, 2019, 2:01 a.m. OK PyPy 3 TESTS 66 483 19558400 2400
59956367 chudy_lukasz1337 F Sept. 3, 2019, 4:19 p.m. OK PyPy 3 TESTS 66 514 24268800 2400
59821452 chudy_lukasz1337 F Aug. 31, 2019, 5:30 p.m. OK PyPy 3 TESTS 66 638 38400000 2400
60493195 beginner1010 F Sept. 13, 2019, 3:16 p.m. OK PyPy 3 TESTS 66 702 27340800 2400
60493554 beginner1010 F Sept. 13, 2019, 3:24 p.m. OK PyPy 3 TESTS 66 717 27340800 2400
64122022 eightants F Nov. 3, 2019, 2:06 a.m. OK Python 2 TESTS 66 1965 64409600 2400
60229829 orailly F Sept. 7, 2019, 4:07 p.m. OK Python 3 TESTS 66 311 20070400 2400
59966421 rushabh1 F Sept. 3, 2019, 8:49 p.m. OK Python 3 TESTS 66 560 18329600 2400
60030868 e.m.blagov F Sept. 4, 2019, 3:22 p.m. OK Python 3 TESTS 66 748 18022400 2400
59836760 Lancern F Sept. 1, 2019, 4:45 a.m. OK Rust TESTS 66 62 4710400 2400
59923810 sansen F Sept. 3, 2019, 2:05 a.m. OK Rust TESTS 66 108 9523200 2400
65715249 sansen F Nov. 25, 2019, 4:15 p.m. OK Rust TESTS 66 217 22323200 2400
60643455 gazaan F Sept. 15, 2019, 4:14 p.m. OK Scala TESTS 66 1934 41984000 2400

remove filters

Back to search problems