Codeforces Round 408 (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
796 Codeforces Round 408 (Div. 2) FINISHED False 7200 284563523 April 10, 2017, 4:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 729 ) E Exam Cheating PROGRAMMING binary search dp 2800

Zane and Zane's crush have just decided to date! However, the girl is having a problem with her Physics final exam, and needs your help. There are n questions, numbered from 1 to n . Question i comes before question i + 1 ( 1 ≤ i < n ). Each of the questions cannot be guessed on, due to the huge penalty for wrong answers. The girl luckily sits in the middle of two geniuses, so she is going to cheat. However, the geniuses have limitations. Each of them may or may not know the answers to some questions. Anyway, it is safe to assume that the answers on their answer sheets are absolutely correct. To make sure she will not get caught by the proctor, the girl will glance at most p times, each time looking at no more than k consecutive questions on one of the two geniuses' answer sheet. When the girl looks at some question on an answer sheet, she copies the answer to that question if it is on that answer sheet, or does nothing otherwise. Help the girl find the maximum number of questions she can get correct. The first line contains three integers n , p , and k ( 1 ≤ n , p ≤ 1, 000 , 1 ≤ k ≤ min ( n , 50) ) — the number of questions, the maximum number of times the girl can glance, and the maximum number of consecutive questions that can be looked at in one time glancing, respectively. The second line starts with one integer r ( 0 ≤ r ≤ n ), denoting the number of questions the first genius has answered on his answer sheet. Then follow r integers a 1 , a 2 , ..., a r ( 1 ≤ a i ≤ n ) — the answered questions, given in a strictly-increasing order (that is, a i < a i + 1 ). The third line starts with one integer s ( 0 ≤ s ≤ n ), denoting the number of questions the second genius has answered on his answer sheet. Then follow s integers b 1 , b 2 , ..., b s ( 1 ≤ b i ≤ n ) — the answered questions, given in a strictly-increasing order (that is, b i < b i + 1 ). Print one integer — the maximum number of questions the girl can answer correctly. Let ( x , l , r ) denote t

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
26301438 tlzmybm E April 11, 2017, 2:33 p.m. OK GNU C++ TESTS 140 46 219545600 2800
26293959 Hachiikung E April 11, 2017, 8:54 a.m. OK GNU C++ TESTS 140 109 26521600 2800
29597737 smtcoder E Aug. 19, 2017, 12:11 p.m. OK GNU C++ TESTS 140 139 217395200 2800
26809245 abhi170893 E May 2, 2017, 8:50 p.m. OK GNU C++ TESTS 140 155 206950400 2800
26448447 unicornt E April 17, 2017, 7:39 a.m. OK GNU C++ TESTS 140 187 26521600 2800
26447904 unicornt E April 17, 2017, 7:06 a.m. OK GNU C++ TESTS 140 202 26521600 2800
26332065 XuYipei E April 13, 2017, 6:38 a.m. OK GNU C++ TESTS 140 202 50892800 2800
30567892 progg_admin E Sept. 21, 2017, 6 a.m. OK GNU C++ TESTS 140 217 24371200 2800
26513158 creatorx E April 20, 2017, 10:40 a.m. OK GNU C++ TESTS 140 233 26316800 2800
26513404 creatorx E April 20, 2017, 10:51 a.m. OK GNU C++ TESTS 140 233 31129600 2800
26298863 rajat1603 E April 11, 2017, 12:48 p.m. OK GNU C++11 TESTS 140 15 3072000 2800
40981237 ReaLNero1 E July 30, 2018, 5:53 p.m. OK GNU C++11 TESTS 140 31 921600 2800
26400480 pacu E April 16, 2017, 12:25 a.m. OK GNU C++11 TESTS 140 46 19968000 2800
26298606 rajat1603 E April 11, 2017, 12:37 p.m. OK GNU C++11 TESTS 140 61 236032000 2800
26340459 chpipis E April 13, 2017, 1:51 p.m. OK GNU C++11 TESTS 140 93 7065600 2800
26294830 Kamfucius E April 11, 2017, 9:34 a.m. OK GNU C++11 TESTS 140 93 211353600 2800
40230533 Mahdi_Jfri E July 12, 2018, 11:47 a.m. OK GNU C++11 TESTS 140 109 18124800 2800
26895889 shubhamgoyal__ E May 6, 2017, 7:57 a.m. OK GNU C++11 TESTS 140 109 24371200 2800
54221221 chhokmah E May 16, 2019, 3:27 a.m. OK GNU C++11 TESTS 140 109 204902400 2800
54221189 vjudge3 E May 16, 2019, 3:27 a.m. OK GNU C++11 TESTS 140 109 204902400 2800
40404518 X_emad_X E July 16, 2018, 9:06 a.m. OK GNU C++14 TESTS 140 31 921600 2800
41151150 tigerwx E Aug. 3, 2018, 8:56 a.m. OK GNU C++14 TESTS 140 31 1228800 2800
34614928 Shivram E Jan. 27, 2018, 6:39 p.m. OK GNU C++14 TESTS 140 31 15155200 2800
40981790 ReaLNero1 E July 30, 2018, 6:08 p.m. OK GNU C++14 TESTS 140 46 24985600 2800
26403598 lys1280023 E April 16, 2017, 4:39 a.m. OK GNU C++14 TESTS 140 62 2764800 2800
26295689 Amayoneko E April 11, 2017, 10:25 a.m. OK GNU C++14 TESTS 140 78 2969600 2800
26330784 victoragnez E April 13, 2017, 4:23 a.m. OK GNU C++14 TESTS 140 93 215040000 2800
26330779 victoragnez E April 13, 2017, 4:22 a.m. OK GNU C++14 TESTS 140 93 215040000 2800
26330958 victoragnez E April 13, 2017, 4:44 a.m. OK GNU C++14 TESTS 140 108 215040000 2800
26297716 Lo_R_D E April 11, 2017, 12:01 p.m. OK GNU C++14 TESTS 140 109 41574400 2800
55421128 karansiwach360 E June 11, 2019, 6:33 a.m. OK GNU C++17 TESTS 140 93 409600 2800
52389938 Vwsrenzk_ZC E April 6, 2019, 11:50 a.m. OK GNU C++17 TESTS 140 93 25497600 2800
40996826 atoiz E July 31, 2018, 4:32 a.m. OK GNU C++17 TESTS 140 139 1126400 2800
58122062 Lucina E Aug. 1, 2019, 11:12 a.m. OK GNU C++17 TESTS 140 140 21913600 2800
66190791 AK. E Dec. 2, 2019, 4:19 p.m. OK GNU C++17 TESTS 140 156 208179200 2800
41972501 szawinis E Aug. 22, 2018, 4:04 p.m. OK GNU C++17 TESTS 140 171 29184000 2800
41971867 szawinis E Aug. 22, 2018, 3:38 p.m. OK GNU C++17 TESTS 140 186 29184000 2800
54495568 Alance E May 22, 2019, 5:33 p.m. OK GNU C++17 TESTS 140 187 1638400 2800
58122536 Lucina E Aug. 1, 2019, 11:23 a.m. OK GNU C++17 TESTS 140 187 10956800 2800
58122435 Lucina E Aug. 1, 2019, 11:21 a.m. OK GNU C++17 TESTS 140 187 10956800 2800
27933615 tri E June 20, 2017, 11:26 p.m. OK Java 8 TESTS 140 326 20684800 2800
26297377 Kammola E April 11, 2017, 11:47 a.m. OK Java 8 TESTS 140 358 39936000 2800
26308013 fnch E April 11, 2017, 9:39 p.m. OK Java 8 TESTS 140 436 33894400 2800
27532789 JPaulsen E June 2, 2017, 11:24 p.m. OK Java 8 TESTS 140 561 0 2800
26510289 donli E April 20, 2017, 7:49 a.m. OK Java 8 TESTS 140 577 20787200 2800
26302444 Kammola E April 11, 2017, 3:16 p.m. OK Java 8 TESTS 140 639 102400000 2800
27535064 huangzr E June 3, 2017, 3:39 a.m. OK Java 8 TESTS 140 1247 0 2800
26820059 RP_9 E May 3, 2017, 1:54 p.m. OK Java 8 TESTS 140 1309 27545600 2800
26413145 Wolfje E April 16, 2017, 12:52 p.m. OK Java 8 TESTS 140 1715 21401600 2800
26469254 Iriskinn E April 18, 2017, 5:45 a.m. OK MS C++ TESTS 140 124 27238400 2800
26527970 P___ E April 20, 2017, 11:48 p.m. OK MS C++ TESTS 140 358 11264000 2800
26527933 P___ E April 20, 2017, 11:43 p.m. OK MS C++ TESTS 140 358 11264000 2800

remove filters

Back to search problems