Codeforces Round 699 (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
1481 Codeforces Round 699 (Div. 2) FINISHED False 7200 132074679 Feb. 5, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11934 ) C Fence Painting PROGRAMMING brute force constructive algorithms greedy implementation

B'You finally woke up after this crazy dream and decided to walk around to clear your head. Outside you saw your house 's fence -- so plain and boring, that you 'd like to repaint it. You have a fence consisting of n planks, where the i -th plank has the color a_i . You want to repaint the fence in such a way that the i -th plank has the color b_i . You 've invited m painters for this purpose. The j -th painter will arrive at the moment j and will recolor exactly one plank to color c_j . For each painter you can choose which plank to recolor, but you can 't turn them down, i. e. each painter has to color exactly one plank. Can you get the coloring b you want? If it 's possible, print for each painter which plank he must paint. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains two integers n and m ( 1 <= n, m <= 10^5 ) -- the number of planks in the fence and the number of painters. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) -- the initial colors of the fence. The third line of each test case contains n integers b_1, b_2, ... , b_n ( 1 <= b_i <= n ) -- the desired colors of the fence. The fourth line of each test case contains m integers c_1, c_2, ... , c_m ( 1 <= c_j <= n ) -- the colors painters have. It 's guaranteed that the sum of n doesn 't exceed 10^5 and the sum of m doesn 't exceed 10^5 over all test cases. For each test case, output "NO" if it is impossible to achieve the coloring b . Otherwise, print "YES" and m integers x_1, x_2, ... , x_m , where x_j is the index of plank the j -th painter should paint. You may print every letter in any case you want (so, for example, the strings "yEs", "yes", "Y'...

Tutorials

Codeforces Round #699 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
106618132 VN.Kiet C Feb. 5, 2021, 6:25 p.m. OK FPC TESTS 21 343 4812800
106634263 SOCAER C Feb. 6, 2021, 1:32 a.m. OK GNU C++11 TESTS 21 46 3993600
106632943 Werner_Yin C Feb. 6, 2021, 12:42 a.m. OK GNU C++11 TESTS 21 46 3993600
106631231 Zhu_Xiangyu C Feb. 5, 2021, 11:32 p.m. OK GNU C++11 TESTS 21 46 5632000
106633770 8178541919 C Feb. 6, 2021, 1:13 a.m. OK GNU C++11 TESTS 21 46 7168000
106641111 zwu2020014736 C Feb. 6, 2021, 4:32 a.m. OK GNU C++11 TESTS 21 46 13721600
106635609 vjudge1 C Feb. 6, 2021, 2:17 a.m. OK GNU C++11 TESTS 21 46 15155200
106638373 Luminolic_Black C Feb. 6, 2021, 3:32 a.m. OK GNU C++11 TESTS 21 62 3174400
106643730 forlight C Feb. 6, 2021, 5:20 a.m. OK GNU C++11 TESTS 21 62 3584000
106633818 wsyhb C Feb. 6, 2021, 1:15 a.m. OK GNU C++11 TESTS 21 62 3686400
106639174 Fate-2001 C Feb. 6, 2021, 3:50 a.m. OK GNU C++11 TESTS 21 62 4300800
106617587 Ma7moud.7amdy C Feb. 5, 2021, 6:18 p.m. OK GNU C++14 TESTS 21 77 3276800
106639363 arv_m C Feb. 6, 2021, 3:54 a.m. OK GNU C++14 TESTS 21 77 3276800
106633866 fr1234 C Feb. 6, 2021, 1:17 a.m. OK GNU C++14 TESTS 21 77 3276800
106607493 Heap_hop C Feb. 5, 2021, 4:34 p.m. OK GNU C++14 TESTS 20 77 3993600
106603884 chen910606 C Feb. 5, 2021, 4:27 p.m. OK GNU C++14 TESTS 20 77 4096000
106623583 ankit7011 C Feb. 5, 2021, 7:42 p.m. OK GNU C++14 TESTS 21 77 4505600
106626105 kpothari C Feb. 5, 2021, 8:31 p.m. OK GNU C++14 TESTS 21 77 6451200
106626110 napgod_pk C Feb. 5, 2021, 8:31 p.m. OK GNU C++14 TESTS 21 77 6451200
106640930 yajusharma12 C Feb. 6, 2021, 4:28 a.m. OK GNU C++14 TESTS 21 78 3276800
106634319 I_love_Kim_Dahyun C Feb. 6, 2021, 1:35 a.m. OK GNU C++14 TESTS 21 78 3686400
106610306 harsh639 C Feb. 5, 2021, 5:18 p.m. OK GNU C++17 TESTS 20 62 4812800
106631935 akcube C Feb. 6, 2021, 12:04 a.m. OK GNU C++17 TESTS 21 77 3276800
106631930 akcube C Feb. 6, 2021, 12:04 a.m. OK GNU C++17 TESTS 21 77 3276800
106611861 Osama_Alkhodairy C Feb. 5, 2021, 5:25 p.m. OK GNU C++17 TESTS 20 77 3276800
106604366 freyes C Feb. 5, 2021, 4:28 p.m. OK GNU C++17 TESTS 20 77 3276800
106638506 Alice_Synthesis C Feb. 6, 2021, 3:35 a.m. OK GNU C++17 TESTS 21 77 3379200
106627061 gabrielwu C Feb. 5, 2021, 8:59 p.m. OK GNU C++17 TESTS 21 77 3686400
106604220 TheMartian0x48 C Feb. 5, 2021, 4:28 p.m. OK GNU C++17 TESTS 20 77 3993600
106621288 Abhiii C Feb. 5, 2021, 7:07 p.m. OK GNU C++17 TESTS 21 77 4096000
106620893 N_Crypted C Feb. 5, 2021, 7:01 p.m. OK GNU C++17 TESTS 21 77 4096000
106631395 Sakuyalove C Feb. 5, 2021, 11:39 p.m. OK GNU C++17 (64) TESTS 21 46 10444800
106633041 sjay05 C Feb. 6, 2021, 12:46 a.m. OK GNU C++17 (64) TESTS 21 61 4403200
106617853 rifatrraazz C Feb. 5, 2021, 6:21 p.m. OK GNU C++17 (64) TESTS 21 61 5120000
106639709 hello_codeforces C Feb. 6, 2021, 4:02 a.m. OK GNU C++17 (64) TESTS 21 61 5222400
106641020 Arrebol C Feb. 6, 2021, 4:30 a.m. OK GNU C++17 (64) TESTS 21 62 4403200
106612113 june_waves C Feb. 5, 2021, 5:27 p.m. OK GNU C++17 (64) TESTS 20 62 4812800
106604969 YousefShereen C Feb. 5, 2021, 4:30 p.m. OK GNU C++17 (64) TESTS 20 62 4812800
106640073 DanielMontes C Feb. 6, 2021, 4:09 a.m. OK GNU C++17 (64) TESTS 21 62 4812800
106617186 Continued_Story C Feb. 5, 2021, 6:13 p.m. OK GNU C++17 (64) TESTS 21 62 4812800
106611926 L1ngYu233 C Feb. 5, 2021, 5:26 p.m. OK GNU C++17 (64) TESTS 20 62 4812800
106638828 0x3F C Feb. 6, 2021, 3:43 a.m. OK Go TESTS 21 187 5324800
106603885 0x3F C Feb. 5, 2021, 4:27 p.m. OK Go TESTS 20 202 4915200
106607967 Pursuit_of_Accepted C Feb. 5, 2021, 4:34 p.m. OK Java 11 TESTS 20 249 0
106621737 decoder_1671 C Feb. 5, 2021, 7:14 p.m. OK Java 11 TESTS 21 265 26624000
106620961 npwolverine C Feb. 5, 2021, 7:02 p.m. OK Java 11 TESTS 21 280 307200
106629869 timg8710 C Feb. 5, 2021, 10:35 p.m. OK Java 11 TESTS 21 280 3174400
106613661 PetrNguyen C Feb. 5, 2021, 5:38 p.m. OK Java 11 TESTS 21 296 3174400
106621786 singhdhanwant C Feb. 5, 2021, 7:15 p.m. OK Java 11 TESTS 21 296 13414400
106622309 singhdhanwant C Feb. 5, 2021, 7:22 p.m. OK Java 11 TESTS 21 296 14028800
106606892 insert_cool_handle C Feb. 5, 2021, 4:33 p.m. OK Java 11 TESTS 20 311 5017600
106604897 ritesharma C Feb. 5, 2021, 4:29 p.m. OK Java 11 TESTS 20 326 16384000
106640105 thesupremeone C Feb. 6, 2021, 4:10 a.m. OK Java 11 TESTS 21 327 12288000
106614073 kalzor C Feb. 5, 2021, 5:42 p.m. OK Java 8 TESTS 21 187 8294400
106605774 pulkit14 C Feb. 5, 2021, 4:31 p.m. OK Java 8 TESTS 20 202 30412800
106621014 nandit C Feb. 5, 2021, 7:03 p.m. OK Java 8 TESTS 21 233 0
106618295 manan_0104 C Feb. 5, 2021, 6:27 p.m. OK Java 8 TESTS 21 233 3174400
106624819 Pranay_ C Feb. 5, 2021, 8:03 p.m. OK Java 8 TESTS 21 233 17920000
106642886 Pranay2516 C Feb. 6, 2021, 5:07 a.m. OK Java 8 TESTS 21 233 17920000
106606436 YashSaxena C Feb. 5, 2021, 4:32 p.m. OK Java 8 TESTS 20 248 4096000
106613960 Khater C Feb. 5, 2021, 5:41 p.m. OK Java 8 TESTS 21 248 5120000
106617889 Abdallah_Ragab00 C Feb. 5, 2021, 6:22 p.m. OK Java 8 TESTS 21 249 10649600
106611366 Dstoical C Feb. 5, 2021, 5:23 p.m. OK Java 8 TESTS 20 264 7270400
106635579 Spheniscine C Feb. 6, 2021, 2:16 a.m. OK Kotlin TESTS 21 233 9216000
106626546 catforce C Feb. 5, 2021, 8:43 p.m. OK Kotlin TESTS 21 373 10137600
106641637 pallav12 C Feb. 6, 2021, 4:42 a.m. OK Kotlin TESTS 21 483 22323200
106641884 pallav12 C Feb. 6, 2021, 4:47 a.m. OK Kotlin TESTS 21 577 38400000
106603617 NikoSun C Feb. 5, 2021, 4:27 p.m. OK MS C++ 2017 TESTS 20 124 3584000
106603633 qing_lin C Feb. 5, 2021, 4:27 p.m. OK MS C++ 2017 TESTS 20 280 2457600
106624231 minigimbob C Feb. 5, 2021, 7:52 p.m. OK MS C++ 2017 TESTS 21 280 6758400
106621003 Albertplus007 C Feb. 5, 2021, 7:03 p.m. OK MS C++ 2017 TESTS 21 280 6963200
106622421 Albertplus007 C Feb. 5, 2021, 7:24 p.m. OK MS C++ 2017 TESTS 21 280 6963200
106645192 Archie98 C Feb. 6, 2021, 5:41 a.m. OK MS C++ 2017 TESTS 21 280 8806400
106628237 ustaritz C Feb. 5, 2021, 9:36 p.m. OK MS C++ 2017 TESTS 21 295 5427200
106620792 Albertplus007 C Feb. 5, 2021, 7 p.m. OK MS C++ 2017 TESTS 21 311 6963200
106643275 letshavesomefun C Feb. 6, 2021, 5:14 a.m. OK MS C++ 2017 TESTS 21 312 4608000
106615417 WCmidschool C Feb. 5, 2021, 5:55 p.m. OK MS C++ 2017 TESTS 21 312 22937600
106631521 mban259 C Feb. 5, 2021, 11:45 p.m. OK .NET Core C# TESTS 21 140 34099200
106640852 ravinem1 C Feb. 6, 2021, 4:26 a.m. OK .NET Core C# TESTS 21 186 23347200
106622307 rsFalse C Feb. 5, 2021, 7:22 p.m. OK Perl TESTS 21 373 56422400
106624494 awoo C Feb. 5, 2021, 7:57 p.m. OK PyPy 2 TESTS 21 343 13004800
106619044 kagu C Feb. 5, 2021, 6:37 p.m. OK PyPy 2 TESTS 21 467 18636800
106622223 kagu C Feb. 5, 2021, 7:21 p.m. OK PyPy 2 TESTS 21 498 18841600
106614712 rivnam C Feb. 5, 2021, 5:48 p.m. OK PyPy 3 TESTS 21 249 17305600
106633867 arin17 C Feb. 6, 2021, 1:17 a.m. OK PyPy 3 TESTS 21 264 40652800
106615875 MrAntonS C Feb. 5, 2021, 5:59 p.m. OK PyPy 3 TESTS 21 265 16384000
106614187 rivnam C Feb. 5, 2021, 5:43 p.m. OK PyPy 3 TESTS 21 280 18432000
106633829 arin17 C Feb. 6, 2021, 1:16 a.m. OK PyPy 3 TESTS 21 280 40243200
106633847 arin17 C Feb. 6, 2021, 1:16 a.m. OK PyPy 3 TESTS 21 280 40448000
106633936 arin17 C Feb. 6, 2021, 1:20 a.m. OK PyPy 3 TESTS 21 296 40652800
106642151 kirito18086 C Feb. 6, 2021, 4:53 a.m. OK PyPy 3 TESTS 21 311 14848000
106633771 arin17 C Feb. 6, 2021, 1:13 a.m. OK PyPy 3 TESTS 21 327 40550400
106642798 kirito18086 C Feb. 6, 2021, 5:06 a.m. OK PyPy 3 TESTS 21 342 14336000
106625837 jramaswami C Feb. 5, 2021, 8:25 p.m. OK Python 3 TESTS 21 311 23654400
106637581 JoaquinManuel C Feb. 6, 2021, 3:15 a.m. OK Python 3 TESTS 21 342 16179200
106613401 VIS_21 C Feb. 5, 2021, 5:36 p.m. OK Python 3 TESTS 21 358 16691200
106618604 YoussefMahm0ud C Feb. 5, 2021, 6:31 p.m. OK Python 3 TESTS 21 420 14950400
106604394 sushanthsamala C Feb. 5, 2021, 4:28 p.m. OK Python 3 TESTS 20 607 25907200
106616215 HETRAKESHFADIA C Feb. 5, 2021, 6:03 p.m. OK Python 3 TESTS 21 670 26624000
106614507 HETRAKESHFADIA C Feb. 5, 2021, 5:46 p.m. OK Python 3 TESTS 21 779 26828800
106625398 SGTCoder C Feb. 5, 2021, 8:16 p.m. OK Python 3 TESTS 21 1091 23449600
106615822 LeoRiether C Feb. 5, 2021, 5:59 p.m. OK Rust TESTS 21 46 4198400
106629394 tommyrheo C Feb. 5, 2021, 10:15 p.m. OK Rust TESTS 21 77 6553600

remove filters

Back to search problems