Codeforces Round 658 (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
1382 Codeforces Round 658 (Div. 2) FINISHED False 7200 141837863 July 21, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 26661 ) A Common Subsequence PROGRAMMING brute force 800

B'You are given two arrays of integers a_1, ldots,a_n and b_1, ldots,b_m . Your task is to find a non-empty array c_1, ldots,c_k that is a subsequence of a_1, ldots,a_n , and also a subsequence of b_1, ldots,b_m . If there are multiple answers, find one of the smallest possible length. If there are still multiple of the smallest possible length, find any. If there are no such arrays, you should report about it. A sequence a is a subsequence of a sequence b if a can be obtained from b by deletion of several (possibly, zero) elements. For example, [3,1] is a subsequence of [3,2,1] and [4,3,1] , but not a subsequence of [1,3,3,7] and [3,10,4] . The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Next 3t lines contain descriptions of test cases. The first line of each test case contains two integers n and m ( 1 <= n,m <= 1000 ) -- the lengths of the two arrays. The second line of each test case contains n integers a_1, ldots,a_n ( 1 <= a_i <= 1000 ) -- the elements of the first array. The third line of each test case contains m integers b_1, ldots,b_m ( 1 <= b_i <= 1000 ) -- the elements of the second array. It is guaranteed that the sum of n and the sum of m across all test cases does not exceed 1000 ( sum limits_{i=1}^t n_i, sum limits_{i=1}^t m_i <= 1000 ). For each test case, output "YES" if a solution exists, or "NO" otherwise. If the answer is "YES", on the next line output an integer k ( 1 <= k <= 1000 ) -- the length of the array, followed by k integers c_1, ldots,c_k ( 1 <= c_i <= 1000 ) -- the elements of the array. If there are multiple solutions with the smallest possible k , output any. In the first test case, [4] is a subsequence of [10, 8, 6, 4] and [1, 2, 3, 4, 5] . This array ha'...

Tutorials

Codeforces Round #658 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
87616951 Gassa A July 21, 2020, 9:57 p.m. OK D TESTS 18 31 8908800 800
87625796 fpc_coder A July 22, 2020, 2:28 a.m. OK FPC TESTS 18 31 3481600 800
87555734 PAG A July 21, 2020, 3:17 p.m. OK FPC TESTS 18 31 5017600 800
87593074 samiul_CSE19 A July 21, 2020, 4:32 p.m. OK GNU C11 TESTS 18 15 3686400 800
87601750 rayeed.rahman123 A July 21, 2020, 6:02 p.m. OK GNU C11 TESTS 18 15 3686400 800
87610212 NikhilSachdeva A July 21, 2020, 7:42 p.m. OK GNU C11 TESTS 18 15 3686400 800
87620668 Bakhtiar_Nafis A July 21, 2020, 11:59 p.m. OK GNU C11 TESTS 18 15 3686400 800
87628086 fahimalhasan2019 A July 22, 2020, 3:17 a.m. OK GNU C11 TESTS 18 15 3686400 800
87562414 Emon_Roy_Bappy A July 21, 2020, 3:29 p.m. OK GNU C11 TESTS 18 15 3686400 800
87566137 ashishsah51 A July 21, 2020, 3:36 p.m. OK GNU C11 TESTS 18 15 3686400 800
87573548 Rohith01 A July 21, 2020, 3:50 p.m. OK GNU C11 TESTS 18 15 3686400 800
87561282 Nivedha_LS A July 21, 2020, 3:27 p.m. OK GNU C11 TESTS 18 15 3686400 800
87561927 fabman_16 A July 21, 2020, 3:28 p.m. OK GNU C11 TESTS 18 15 3686400 800
87628758 CCPSDCGK A July 22, 2020, 3:32 a.m. OK GNU C++11 TESTS 18 15 3686400 800
87564116 Mueez_007 A July 21, 2020, 3:32 p.m. OK GNU C++11 TESTS 18 15 3686400 800
87623762 cnt1405935990 A July 22, 2020, 1:40 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87628987 Karlis A July 22, 2020, 3:36 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87637544 chenke A July 22, 2020, 5:55 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87635716 Satyam1104 A July 22, 2020, 5:30 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87629547 liqingyang A July 22, 2020, 3:46 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87616919 Tofig_Aliev A July 21, 2020, 9:56 p.m. OK GNU C++11 TESTS 18 15 3891200 800
87629064 zlczlc A July 22, 2020, 3:38 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87622894 liningyuan19 A July 22, 2020, 1:18 a.m. OK GNU C++11 TESTS 18 15 3891200 800
87637823 FahimMuntasir A July 22, 2020, 5:59 a.m. OK GNU C++14 TESTS 18 30 3686400 800
87635026 clarkent A July 22, 2020, 5:21 a.m. OK GNU C++14 TESTS 18 30 3686400 800
87625143 Priyank A July 22, 2020, 2:16 a.m. OK GNU C++14 TESTS 18 30 3686400 800
87624226 clearlove4396 A July 22, 2020, 1:54 a.m. OK GNU C++14 TESTS 18 30 3686400 800
87623738 jainchethan87 A July 22, 2020, 1:40 a.m. OK GNU C++14 TESTS 18 30 3686400 800
87602239 shawon_UU A July 21, 2020, 6:06 p.m. OK GNU C++14 TESTS 18 30 3686400 800
87601111 ash0904 A July 21, 2020, 5:56 p.m. OK GNU C++14 TESTS 18 30 3686400 800
87601070 adityarajiv A July 21, 2020, 5:56 p.m. OK GNU C++14 TESTS 18 30 3686400 800
87596860 code2307 A July 21, 2020, 5:27 p.m. OK GNU C++14 TESTS 18 30 3686400 800
87578715 Nabonita A July 21, 2020, 4:02 p.m. OK GNU C++14 TESTS 18 30 3686400 800
87597507 sahil09059 A July 21, 2020, 5:30 p.m. OK GNU C++17 TESTS 18 15 3891200 800
87600686 limabeans A July 21, 2020, 5:52 p.m. OK GNU C++17 TESTS 18 15 3891200 800
87612360 Homo_sapiens_MAX A July 21, 2020, 8:16 p.m. OK GNU C++17 TESTS 18 30 3686400 800
87637780 Shridhar A July 22, 2020, 5:58 a.m. OK GNU C++17 TESTS 18 30 3686400 800
87633658 _shinchan_02 A July 22, 2020, 5 a.m. OK GNU C++17 TESTS 18 30 3686400 800
87629847 eamon831 A July 22, 2020, 3:52 a.m. OK GNU C++17 TESTS 18 30 3686400 800
87629180 singhal_harsh A July 22, 2020, 3:40 a.m. OK GNU C++17 TESTS 18 30 3686400 800
87626012 huypt A July 22, 2020, 2:33 a.m. OK GNU C++17 TESTS 18 30 3686400 800
87624866 phuteobs0166 A July 22, 2020, 2:09 a.m. OK GNU C++17 TESTS 18 30 3686400 800
87620083 bitsplz A July 21, 2020, 11:38 p.m. OK GNU C++17 TESTS 18 30 3686400 800
87624785 Infuse A July 22, 2020, 2:07 a.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87559062 dhainik_suthar A July 21, 2020, 3:23 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87566202 Adam_pxx A July 21, 2020, 3:36 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87568479 mohaayman009 A July 21, 2020, 3:40 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87597673 Ari A July 21, 2020, 5:31 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87598128 hardiksh0512 A July 21, 2020, 5:33 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87619142 Konohamaru A July 21, 2020, 11 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87620058 Ameliorate A July 21, 2020, 11:37 p.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87622030 vjudge2 A July 22, 2020, 12:51 a.m. OK GNU C++17 (64) TESTS 18 15 4300800 800
87622479 fakhoury A July 22, 2020, 1:05 a.m. OK GNU C++17 (64) TESTS 18 15 4403200 800
87607380 meooow A July 21, 2020, 7:02 p.m. OK Go TESTS 18 46 10854400 800
87607619 meooow A July 21, 2020, 7:05 p.m. OK Go TESTS 18 46 10956800 800
87572785 jojo1094 A July 21, 2020, 3:49 p.m. OK Go TESTS 18 46 10956800 800
87599670 iamgabruh A July 21, 2020, 5:44 p.m. OK Java 11 TESTS 18 171 23756800 800
87621929 pepradere A July 22, 2020, 12:47 a.m. OK Java 11 TESTS 18 187 23961600 800
87618823 bobib A July 21, 2020, 10:51 p.m. OK Java 11 TESTS 18 187 23961600 800
87611796 somanichinmay7 A July 21, 2020, 8:07 p.m. OK Java 11 TESTS 18 187 23961600 800
87604470 amit_chas A July 21, 2020, 6:28 p.m. OK Java 11 TESTS 18 187 23961600 800
87596492 O-infinity A July 21, 2020, 5:26 p.m. OK Java 11 TESTS 18 187 23961600 800
87566673 Apass.Jack A July 21, 2020, 3:37 p.m. OK Java 11 TESTS 18 187 23961600 800
87552797 tanmaychakrabortydhn A July 21, 2020, 3:12 p.m. OK Java 11 TESTS 18 187 23961600 800
87563026 jonathanxue A July 21, 2020, 3:30 p.m. OK Java 11 TESTS 18 202 23859200 800
87582239 TheRunner A July 21, 2020, 4:10 p.m. OK Java 11 TESTS 18 202 23961600 800
87617532 Hasib_Ullah A July 21, 2020, 10:13 p.m. OK Java 8 TESTS 18 108 20377600 800
87603722 Calthor A July 21, 2020, 6:20 p.m. OK Java 8 TESTS 18 108 20377600 800
87611813 chinmaysomani7 A July 21, 2020, 8:07 p.m. OK Java 8 TESTS 18 108 20480000 800
87568306 Baka25 A July 21, 2020, 3:40 p.m. OK Java 8 TESTS 18 108 20480000 800
87556583 king_ckm007 A July 21, 2020, 3:19 p.m. OK Java 8 TESTS 18 109 20377600 800
87554658 dewanshnigam A July 21, 2020, 3:15 p.m. OK Java 8 TESTS 18 109 20377600 800
87554706 AWahba A July 21, 2020, 3:15 p.m. OK Java 8 TESTS 18 109 20377600 800
87625281 make_master A July 22, 2020, 2:18 a.m. OK Java 8 TESTS 18 109 20377600 800
87597090 nandit A July 21, 2020, 5:28 p.m. OK Java 8 TESTS 18 109 20377600 800
87563388 Ahamed_TJ A July 21, 2020, 3:31 p.m. OK Java 8 TESTS 18 109 20377600 800
87600307 Tlatoani A July 21, 2020, 5:49 p.m. OK Kotlin TESTS 18 124 21606400 800
87604541 DieAnderen A July 21, 2020, 6:29 p.m. OK Kotlin TESTS 18 155 21196800 800
87555111 StrawHat9 A July 21, 2020, 3:16 p.m. OK Mono C# TESTS 18 62 8806400 800
87572422 alexandre.marcondes A July 21, 2020, 3:48 p.m. OK Mono C# TESTS 18 77 8908800 800
87601303 EmK A July 21, 2020, 5:58 p.m. OK Mono C# TESTS 18 77 12697600 800
87626069 _Trung_Nguyen A July 22, 2020, 2:34 a.m. OK Mono C# TESTS 18 77 80998400 800
87635792 siscon_org A July 22, 2020, 5:31 a.m. OK MS C++ TESTS 18 31 4096000 800
87552536 Pilacis A July 21, 2020, 3:12 p.m. OK MS C++ TESTS 18 31 4198400 800
87584549 kashyapaditya1234 A July 21, 2020, 4:15 p.m. OK MS C++ TESTS 18 31 4198400 800
87572177 Smiita A July 21, 2020, 3:48 p.m. OK MS C++ TESTS 18 31 4198400 800
87566421 smetan_ka A July 21, 2020, 3:36 p.m. OK MS C++ TESTS 18 31 4198400 800
87556387 CFWudanna A July 21, 2020, 3:18 p.m. OK MS C++ TESTS 18 46 8294400 800
87579248 dayun6530 A July 21, 2020, 4:03 p.m. OK MS C++ 2017 TESTS 18 31 3686400 800
87615022 turxtar A July 21, 2020, 9:09 p.m. OK MS C++ 2017 TESTS 18 31 3686400 800
87571823 mansi.iffco A July 21, 2020, 3:47 p.m. OK MS C++ 2017 TESTS 18 31 3686400 800
87558783 u3o8_ A July 21, 2020, 3:22 p.m. OK MS C++ 2017 TESTS 18 31 3686400 800
87560833 willhebe A July 21, 2020, 3:26 p.m. OK MS C++ 2017 TESTS 18 31 3686400 800
87568516 thuwarageshj A July 21, 2020, 3:40 p.m. OK MS C++ 2017 TESTS 18 31 3686400 800
87596564 Gravekper A July 21, 2020, 5:26 p.m. OK MS C++ 2017 TESTS 18 31 3788800 800
87614524 aaronzrliu A July 21, 2020, 8:59 p.m. OK MS C++ 2017 TESTS 18 31 3788800 800
87605579 VladislavArt A July 21, 2020, 6:41 p.m. OK MS C++ 2017 TESTS 18 31 3788800 800
87605421 kupriyanov A July 21, 2020, 6:39 p.m. OK MS C++ 2017 TESTS 18 31 3788800 800
87572470 lefto499 A July 21, 2020, 3:48 p.m. OK PascalABC.NET TESTS 18 311 25702400 800
87567338 EgorStar A July 21, 2020, 3:38 p.m. OK PascalABC.NET TESTS 18 326 34099200 800
87566488 hudzenkodenys A July 21, 2020, 3:36 p.m. OK PascalABC.NET TESTS 18 482 49971200 800
87598855 mayakin A July 21, 2020, 5:38 p.m. OK PHP TESTS 18 31 6041600 800
87614920 beethoven97 A July 21, 2020, 9:07 p.m. OK PyPy 2 TESTS 18 109 23244800 800
87604956 realnimish A July 21, 2020, 6:33 p.m. OK PyPy 2 TESTS 18 171 24985600 800
87558276 amfolity A July 21, 2020, 3:22 p.m. OK PyPy 3 TESTS 18 140 21708800 800
87629158 18211a04p1 A July 22, 2020, 3:39 a.m. OK PyPy 3 TESTS 18 140 22016000 800
87588511 Siddhant_Khare A July 21, 2020, 4:24 p.m. OK PyPy 3 TESTS 18 140 22118400 800
87604233 EpicChadGamer A July 21, 2020, 6:26 p.m. OK PyPy 3 TESTS 18 155 21606400 800
87598043 bravotango A July 21, 2020, 5:33 p.m. OK PyPy 3 TESTS 18 155 22016000 800
87560692 engcraft A July 21, 2020, 3:26 p.m. OK PyPy 3 TESTS 18 155 22118400 800
87603566 shubham26857 A July 21, 2020, 6:19 p.m. OK PyPy 3 TESTS 18 171 22323200 800
87588192 NoLuck A July 21, 2020, 4:23 p.m. OK PyPy 3 TESTS 18 186 22630400 800
87602190 Shagoto A July 21, 2020, 6:06 p.m. OK PyPy 3 TESTS 18 186 23347200 800
87617015 ayush_nishad A July 21, 2020, 9:58 p.m. OK PyPy 3 TESTS 18 187 22323200 800
87600611 Hitikkumar A July 21, 2020, 5:51 p.m. OK Python 2 TESTS 18 156 6451200 800
87565859 Bluefish2 A July 21, 2020, 3:35 p.m. OK Python 2 TESTS 18 156 6553600 800
87630648 GodParticle_17 A July 22, 2020, 4:06 a.m. OK Python 3 TESTS 18 93 6963200 800
87629702 sul3 A July 22, 2020, 3:49 a.m. OK Python 3 TESTS 18 93 6963200 800
87614695 duckladydinh A July 21, 2020, 9:02 p.m. OK Python 3 TESTS 18 93 6963200 800
87592245 EtTuBrute A July 21, 2020, 4:31 p.m. OK Python 3 TESTS 18 93 6963200 800
87582299 VishalKaushik A July 21, 2020, 4:10 p.m. OK Python 3 TESTS 18 93 6963200 800
87567813 Ajay.Patel A July 21, 2020, 3:39 p.m. OK Python 3 TESTS 18 93 6963200 800
87557993 ysss A July 21, 2020, 3:21 p.m. OK Python 3 TESTS 18 93 6963200 800
87557721 rohanpop87 A July 21, 2020, 3:21 p.m. OK Python 3 TESTS 18 93 6963200 800
87637494 anirbannayek2 A July 22, 2020, 5:54 a.m. OK Python 3 TESTS 18 108 6963200 800
87634393 athmish A July 22, 2020, 5:12 a.m. OK Python 3 TESTS 18 108 6963200 800
87554168 sheremi33 A July 21, 2020, 3:15 p.m. OK Ruby TESTS 18 514 49561600 800
87563816 zoom_cyberpunk A July 21, 2020, 3:31 p.m. OK Ruby TESTS 18 529 49561600 800
87574255 freshnewname A July 21, 2020, 3:52 p.m. OK Rust TESTS 18 31 3788800 800
87584651 avocado.shrimp A July 21, 2020, 4:15 p.m. OK Rust TESTS 18 46 3788800 800

remove filters

Back to search problems