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 |
---|---|---|---|---|---|---|
1917 | Codeforces Round 917 (Div. 2) | FINISHED | False | 7200 | 33751463 | Dec. 24, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 10865 ) | C | Watering an Array | PROGRAMMING | brute force greedy implementation math |
B"You have an array of integers a_1, a_2, ldots, a_n of length n . On the i -th of the next d days you are going to do exactly one of the following two actions: Your score is equal to 0 in the beginning. Note that on each day you should perform exactly one of the actions above: you cannot skip a day or perform both actions on the same day. What is the maximum score you can achieve at the end? Since d can be quite large, the sequence b is given to you in the compressed format: The first line contains a single integer t ( 1 <= t <= 10^3 ) -- the number of test cases. The first line of each test case contains three integers n , k and d ( 1 <= n <= 2000 , 1 <= k <= 10^5 , k <= d <= 10^9 ) -- the length of the array a , the length of the sequence v and the number of days you are going to perform operations on. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i <= n ) -- the array a . The third line of each test case contains k integers v_1, v_2, ldots, v_k ( 1 <= v_i <= n ) -- the sequence v . It is guaranteed that the sum of n over all test cases doesn't exceed 2000 and the sum of k over all test cases doesn't exceed 10^5 . For each test case, output one integer: the maximum score you can achieve at the end of the d -th day. In the first test case, the sequence b is equal to [1, 3, 2, 3, 1, 3, 2, 3, ldots] and one of the optimal solutions for this case is as follows: It can be shown that it is impossible to score more than 4 , so the answer is 4 . In the second test case, the sequence b is equal to [6, 6, 6, 6, ldots] . One of the ways to score 3 is to perform operations of the first type on the 1 -st and the 3 -rd days and to perform an operation of the second type on the 2 -nd day. "... |
Editorial of Codeforces Round 917 (Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
238736296 | andrejerry1 | C | Dec. 24, 2023, 4:30 p.m. | OK | C# 10 | TESTS | 36 | 78 | 17408000 | ||
238746270 | S_a_R_1729 | C | Dec. 24, 2023, 5:48 p.m. | OK | GNU C11 | TESTS | 37 | 842 | 4812800 | ||
238746545 | JustLogN | C | Dec. 24, 2023, 5:50 p.m. | OK | GNU C++14 | TESTS | 37 | 31 | 3481600 | ||
238746381 | sqrtN | C | Dec. 24, 2023, 5:49 p.m. | OK | GNU C++14 | TESTS | 37 | 31 | 3481600 | ||
238742915 | HoriaB | C | Dec. 24, 2023, 5:33 p.m. | OK | GNU C++14 | TESTS | 36 | 46 | 1433600 | ||
238734856 | vegetable_cos | C | Dec. 24, 2023, 4:27 p.m. | OK | GNU C++14 | TESTS | 36 | 46 | 1433600 | ||
238758327 | M.Qattan | C | Dec. 24, 2023, 7:41 p.m. | OK | GNU C++14 | TESTS | 38 | 46 | 1433600 | ||
238762370 | HoriaB | C | Dec. 24, 2023, 8:40 p.m. | OK | GNU C++14 | TESTS | 38 | 46 | 1433600 | ||
238744975 | Yzm007 | C | Dec. 24, 2023, 5:41 p.m. | OK | GNU C++14 | TESTS | 36 | 46 | 1536000 | ||
238760074 | Rushdi | C | Dec. 24, 2023, 8:06 p.m. | OK | GNU C++14 | TESTS | 38 | 46 | 1638400 | ||
238769359 | omeganot | C | Dec. 24, 2023, 11:37 p.m. | OK | GNU C++14 | TESTS | 39 | 46 | 1638400 | ||
238772105 | lostsky3 | C | Dec. 25, 2023, 1:22 a.m. | OK | GNU C++14 | TESTS | 39 | 46 | 1638400 | ||
238743069 | Hihihah | C | Dec. 24, 2023, 5:33 p.m. | OK | GNU C++17 | TESTS | 36 | 31 | 1433600 | ||
238754100 | alpha-1.1 | C | Dec. 24, 2023, 6:48 p.m. | OK | GNU C++17 | TESTS | 38 | 31 | 1638400 | ||
238784002 | _Phoenix_7 | C | Dec. 25, 2023, 5:14 a.m. | OK | GNU C++17 | TESTS | 39 | 31 | 2355200 | ||
238786745 | Pash_Mak | C | Dec. 25, 2023, 5:41 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238786686 | Pash_Mak | C | Dec. 25, 2023, 5:40 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238781537 | alchemist_5 | C | Dec. 25, 2023, 4:43 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238787015 | WintersBlizzard | C | Dec. 25, 2023, 5:44 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238775247 | Uttam_Paharia | C | Dec. 25, 2023, 2:52 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238773270 | rahulk736694 | C | Dec. 25, 2023, 2:02 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238777033 | MinhHoangLe | C | Dec. 25, 2023, 3:29 a.m. | OK | GNU C++17 | TESTS | 39 | 46 | 1433600 | ||
238786981 | Llinhao | C | Dec. 25, 2023, 5:43 a.m. | OK | GNU C++17 (64) | TESTS | 39 | 31 | 1638400 | ||
238778247 | Dynamic_Pigeon | C | Dec. 25, 2023, 3:50 a.m. | OK | GNU C++17 (64) | TESTS | 39 | 31 | 1638400 | ||
238776055 | yuanmingyuan | C | Dec. 25, 2023, 3:10 a.m. | OK | GNU C++17 (64) | TESTS | 39 | 31 | 1638400 | ||
238773369 | fs20091003 | C | Dec. 25, 2023, 2:06 a.m. | OK | GNU C++17 (64) | TESTS | 39 | 31 | 1638400 | ||
238772769 | TralSun | C | Dec. 25, 2023, 1:46 a.m. | OK | GNU C++17 (64) | TESTS | 39 | 31 | 1638400 | ||
238771067 | hu1220211066 | C | Dec. 25, 2023, 12:45 a.m. | OK | GNU C++17 (64) | TESTS | 39 | 31 | 1638400 | ||
238766678 | xcdtlatin2 | C | Dec. 24, 2023, 10:12 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 31 | 1638400 | ||
238755793 | sabino1 | C | Dec. 24, 2023, 7:07 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 31 | 1638400 | ||
238753187 | kkwantac | C | Dec. 24, 2023, 6:39 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 31 | 1638400 | ||
238752874 | Owmicron | C | Dec. 24, 2023, 6:36 p.m. | OK | GNU C++17 (64) | TESTS | 38 | 31 | 1638400 | ||
238746918 | llliill | C | Dec. 24, 2023, 5:52 p.m. | OK | GNU C++20 (64) | TESTS | 37 | 15 | 1740800 | ||
238737301 | Fio | C | Dec. 24, 2023, 4:32 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 30 | 1740800 | ||
238743796 | MinaRagy06 | C | Dec. 24, 2023, 5:36 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 30 | 2048000 | ||
238745009 | alfonso_ | C | Dec. 24, 2023, 5:41 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 30 | 2150400 | ||
238735564 | GreySpecter | C | Dec. 24, 2023, 4:28 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 31 | 1331200 | ||
238786891 | Briceby | C | Dec. 25, 2023, 5:42 a.m. | OK | GNU C++20 (64) | TESTS | 39 | 31 | 1638400 | ||
238785318 | hbg1345 | C | Dec. 25, 2023, 5:27 a.m. | OK | GNU C++20 (64) | TESTS | 39 | 31 | 1638400 | ||
238785282 | hbg1345 | C | Dec. 25, 2023, 5:26 a.m. | OK | GNU C++20 (64) | TESTS | 39 | 31 | 1638400 | ||
238786775 | 3bkarm | C | Dec. 25, 2023, 5:41 a.m. | OK | GNU C++20 (64) | TESTS | 39 | 31 | 1638400 | ||
238787846 | 9756 | C | Dec. 25, 2023, 5:53 a.m. | OK | GNU C++20 (64) | TESTS | 39 | 31 | 1638400 | ||
238744353 | newbie1234567 | C | Dec. 24, 2023, 5:39 p.m. | OK | Java 11 | TESTS | 36 | 187 | 24678400 | ||
238745540 | aryansingh27 | C | Dec. 24, 2023, 5:44 p.m. | OK | Java 11 | TESTS | 37 | 187 | 24678400 | ||
238751556 | ....----.... | C | Dec. 24, 2023, 6:24 p.m. | OK | Java 11 | TESTS | 38 | 202 | 24576000 | ||
238775273 | believe18 | C | Dec. 25, 2023, 2:53 a.m. | OK | Java 11 | TESTS | 39 | 202 | 24678400 | ||
238737354 | gaurav4720 | C | Dec. 24, 2023, 4:32 p.m. | OK | Java 11 | TESTS | 36 | 202 | 24678400 | ||
238761660 | venkateshaprabhu | C | Dec. 24, 2023, 8:29 p.m. | OK | Java 11 | TESTS | 38 | 249 | 138342400 | ||
238775048 | mattr | C | Dec. 25, 2023, 2:47 a.m. | OK | Java 11 | TESTS | 39 | 280 | 24576000 | ||
238765480 | Baniya_09 | C | Dec. 24, 2023, 9:43 p.m. | OK | Java 11 | TESTS | 38 | 296 | 25292800 | ||
238779204 | muskan05gupta | C | Dec. 25, 2023, 4:08 a.m. | OK | Java 11 | TESTS | 39 | 311 | 25292800 | ||
238779294 | muskan05gupta | C | Dec. 25, 2023, 4:09 a.m. | OK | Java 11 | TESTS | 39 | 327 | 25292800 | ||
238750722 | GaleStarr | C | Dec. 24, 2023, 6:18 p.m. | OK | Java 17 | TESTS | 37 | 265 | 40345600 | ||
238746988 | Yousef_Badr | C | Dec. 24, 2023, 5:52 p.m. | OK | Java 17 | TESTS | 37 | 295 | 40448000 | ||
238754213 | egor4444ik | C | Dec. 24, 2023, 6:49 p.m. | OK | Java 17 | TESTS | 38 | 296 | 40550400 | ||
238783389 | gugg | C | Dec. 25, 2023, 5:07 a.m. | OK | Java 17 | TESTS | 39 | 405 | 40755200 | ||
238749547 | jai_hanumant | C | Dec. 24, 2023, 6:09 p.m. | OK | Java 17 | TESTS | 37 | 421 | 40755200 | ||
238761710 | snowyrsb | C | Dec. 24, 2023, 8:30 p.m. | OK | Java 17 | TESTS | 38 | 608 | 40448000 | ||
238774013 | MrSharpedge | C | Dec. 25, 2023, 2:23 a.m. | OK | Java 21 | TESTS | 39 | 264 | 41779200 | ||
238744970 | jasrajsb | C | Dec. 24, 2023, 5:41 p.m. | OK | Java 21 | TESTS | 36 | 280 | 41676800 | ||
238773891 | MrSharpedge | C | Dec. 25, 2023, 2:20 a.m. | OK | Java 21 | TESTS | 39 | 280 | 41984000 | ||
238746724 | d2s2 | C | Dec. 24, 2023, 5:51 p.m. | OK | Java 21 | TESTS | 37 | 296 | 42086400 | ||
238748904 | SamyajitDas | C | Dec. 24, 2023, 6:04 p.m. | OK | Java 21 | TESTS | 37 | 327 | 41779200 | ||
238775639 | Ligh0x74 | C | Dec. 25, 2023, 3:01 a.m. | OK | Java 21 | TESTS | 39 | 327 | 41881600 | ||
238770040 | Pythagoras561 | C | Dec. 25, 2023, 12:03 a.m. | OK | Java 21 | TESTS | 39 | 327 | 47820800 | ||
238777503 | Ligh0x74 | C | Dec. 25, 2023, 3:37 a.m. | OK | Java 21 | TESTS | 39 | 342 | 41984000 | ||
238785216 | Akash_Sardar | C | Dec. 25, 2023, 5:26 a.m. | OK | Java 21 | TESTS | 39 | 342 | 48844800 | ||
238742212 | Akash_Sardar | C | Dec. 24, 2023, 5:29 p.m. | OK | Java 21 | TESTS | 36 | 390 | 48332800 | ||
238762107 | vatsal_04 | C | Dec. 24, 2023, 8:36 p.m. | OK | Java 8 | TESTS | 38 | 124 | 18841600 | ||
238746745 | faresbadr316 | C | Dec. 24, 2023, 5:51 p.m. | OK | Java 8 | TESTS | 37 | 124 | 18841600 | ||
238753435 | naitikvarshney | C | Dec. 24, 2023, 6:41 p.m. | OK | Java 8 | TESTS | 38 | 124 | 18944000 | ||
238738118 | MintCat | C | Dec. 24, 2023, 4:34 p.m. | OK | Java 8 | TESTS | 36 | 124 | 18944000 | ||
238762194 | vatsal_04 | C | Dec. 24, 2023, 8:37 p.m. | OK | Java 8 | TESTS | 38 | 139 | 18841600 | ||
238764262 | rj3377295 | C | Dec. 24, 2023, 9:16 p.m. | OK | Java 8 | TESTS | 38 | 139 | 18944000 | ||
238762058 | vatsal_04 | C | Dec. 24, 2023, 8:35 p.m. | OK | Java 8 | TESTS | 38 | 140 | 18841600 | ||
238745983 | vijay_panwar12 | C | Dec. 24, 2023, 5:47 p.m. | OK | Java 8 | TESTS | 37 | 140 | 18841600 | ||
238754518 | Sumitsingh7 | C | Dec. 24, 2023, 6:52 p.m. | OK | Java 8 | TESTS | 38 | 156 | 27033600 | ||
238744319 | formidablechief27 | C | Dec. 24, 2023, 5:38 p.m. | OK | Java 8 | TESTS | 36 | 171 | 23449600 | ||
238772510 | tauros | C | Dec. 25, 2023, 1:37 a.m. | OK | Kotlin 1.6 | TESTS | 39 | 343 | 26316800 | ||
238773197 | tauros | C | Dec. 25, 2023, 2 a.m. | OK | Kotlin 1.6 | TESTS | 39 | 358 | 26316800 | ||
238747528 | arvindf232 | C | Dec. 24, 2023, 5:56 p.m. | OK | Kotlin 1.6 | TESTS | 37 | 1980 | 25600000 | ||
238766556 | cstack99 | C | Dec. 24, 2023, 10:09 p.m. | OK | MS C++ 2017 | TESTS | 38 | 93 | 1536000 | ||
238759443 | iuxan | C | Dec. 24, 2023, 7:56 p.m. | OK | MS C++ 2017 | TESTS | 38 | 93 | 1536000 | ||
238782160 | Ravitosh | C | Dec. 25, 2023, 4:51 a.m. | OK | MS C++ 2017 | TESTS | 39 | 140 | 1945600 | ||
238735930 | vlk0 | C | Dec. 24, 2023, 4:29 p.m. | OK | PyPy 3 | TESTS | 36 | 171 | 26521600 | ||
238741795 | lisashi | C | Dec. 24, 2023, 5:28 p.m. | OK | PyPy 3 | TESTS | 36 | 171 | 26726400 | ||
238743008 | jvatsal0709 | C | Dec. 24, 2023, 5:33 p.m. | OK | PyPy 3 | TESTS | 36 | 202 | 26726400 | ||
238743525 | seeforty4040 | C | Dec. 24, 2023, 5:35 p.m. | OK | PyPy 3 | TESTS | 36 | 218 | 28057600 | ||
238745922 | tan_delhi | C | Dec. 24, 2023, 5:47 p.m. | OK | PyPy 3 | TESTS | 37 | 358 | 28569600 | ||
238782649 | pratyanch_jain | C | Dec. 25, 2023, 4:58 a.m. | OK | PyPy 3-64 | TESTS | 39 | 108 | 40755200 | ||
238782180 | StanMarsh-SP | C | Dec. 25, 2023, 4:52 a.m. | OK | PyPy 3-64 | TESTS | 39 | 109 | 42291200 | ||
238769554 | pierrot | C | Dec. 24, 2023, 11:45 p.m. | OK | PyPy 3-64 | TESTS | 39 | 109 | 42598400 | ||
238755009 | Lotrick | C | Dec. 24, 2023, 6:58 p.m. | OK | PyPy 3-64 | TESTS | 38 | 124 | 39936000 | ||
238772264 | scyyyyyyyyyy | C | Dec. 25, 2023, 1:28 a.m. | OK | PyPy 3-64 | TESTS | 39 | 124 | 42700800 | ||
238766015 | daszybak | C | Dec. 24, 2023, 9:56 p.m. | OK | PyPy 3-64 | TESTS | 38 | 124 | 42700800 | ||
238747457 | Hossam_Hassan_Taher | C | Dec. 24, 2023, 5:55 p.m. | OK | PyPy 3-64 | TESTS | 37 | 124 | 42803200 | ||
238787161 | mega_bot | C | Dec. 25, 2023, 5:46 a.m. | OK | PyPy 3-64 | TESTS | 39 | 124 | 43008000 | ||
238757122 | Eunha | C | Dec. 24, 2023, 7:24 p.m. | OK | PyPy 3-64 | TESTS | 38 | 124 | 43008000 | ||
238785725 | 2100032523 | C | Dec. 25, 2023, 5:31 a.m. | OK | PyPy 3-64 | TESTS | 39 | 124 | 43827200 | ||
238756127 | Redpanda_x | C | Dec. 24, 2023, 7:11 p.m. | OK | Python 3 | TESTS | 38 | 935 | 19251200 | ||
238758008 | bittercof | C | Dec. 24, 2023, 7:36 p.m. | OK | Python 3 | TESTS | 38 | 1013 | 19763200 | ||
238774024 | yeling | C | Dec. 25, 2023, 2:23 a.m. | OK | Python 3 | TESTS | 39 | 1106 | 21504000 | ||
238751777 | lapras100 | C | Dec. 24, 2023, 6:26 p.m. | OK | Python 3 | TESTS | 38 | 1200 | 19865600 | ||
238760296 | parashar22475 | C | Dec. 24, 2023, 8:09 p.m. | OK | Python 3 | TESTS | 38 | 1653 | 19660800 | ||
238746549 | xNapkin | C | Dec. 24, 2023, 5:50 p.m. | OK | Python 3 | TESTS | 37 | 1669 | 19763200 | ||
238734082 | MenjoyerL | C | Dec. 24, 2023, 4:25 p.m. | OK | Python 3 | TESTS | 36 | 1669 | 19763200 | ||
238755463 | _Lago_ | C | Dec. 24, 2023, 7:03 p.m. | OK | Python 3 | TESTS | 38 | 1840 | 19763200 | ||
238741979 | Loganwick | C | Dec. 24, 2023, 5:29 p.m. | OK | Rust 2021 | TESTS | 36 | 31 | 3379200 | ||
238753804 | tamuraup_wa | C | Dec. 24, 2023, 6:45 p.m. | OK | Rust 2021 | TESTS | 38 | 31 | 3891200 | ||
238737236 | Samyak_15 | C | Dec. 24, 2023, 4:32 p.m. | OK | Rust 2021 | TESTS | 36 | 31 | 4915200 | ||
238753064 | kost | C | Dec. 24, 2023, 6:37 p.m. | OK | Rust 2021 | TESTS | 38 | 296 | 9011200 |
Back to search problems