Codeforces Round 860 (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
1798 Codeforces Round 860 (Div. 2) FINISHED False 7200 57338663 March 26, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 521 ) F Gifts from Grandfather Ahmed PROGRAMMING dp math number theory 2500

B"Grandfather Ahmed's School has n+1 students. The students are divided into k classes, and s_i students study in the i -th class. So, s_1 + s_2 + ldots + s_k = n+1 . Due to the upcoming April Fools' Day, all students will receive gifts! Grandfather Ahmed planned to order n+1 boxes of gifts. Each box can contain one or more gifts. He plans to distribute the boxes between classes so that the following conditions are satisfied: Unfortunately, Grandfather Ahmed ordered only n boxes with gifts, the i -th of which contains a_i gifts. Ahmed has to buy the missing gift box, and the number of gifts in the box should be an integer between 1 and 10^6 . Help Ahmed to determine, how many gifts should the missing box contain, and build a suitable distribution of boxes to classes, or report that this is impossible. The first line of the input contains two integers n and k ( 1 <= n, k <= 200 , k <= n + 1 ). The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^6 ) -- the number of gifts in the available boxes. The third line contains k integers s_1, s_2, ldots, s_k ( 1 <= s_i <= n+1 ) -- the number of students in classes. It is guaranteed that sum s_i = n+1 . If there is no way to buy the remaining box, output the integer -1 in a single line. Otherwise, in the first line, output a single integer s -- the number of gifts in the box that Grandfather Ahmed should buy ( 1 <= s <= 10^6 ). Next, in k lines, print the distribution of boxes to classes. In the i -th line print s_i integers -- the sizes of the boxes that should be sent to the i -th class. If there are multiple solutions, print any of them. In the first test, Grandfather Ahmed can buy a box with just 1 gift. After that, two boxes with 7 gifts are sent to the first class. 7 + 7 = 14 is divisible by 2$$"...

Tutorials

Editorial of Codeforces Round 860 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
199833226 FLY_lai F March 30, 2023, 1:57 p.m. OK Clang++20 Diagnostics TESTS 59 187 26521600 2500
199803191 lprdsb F March 30, 2023, 9:26 a.m. OK GNU C++14 TESTS 59 15 512000 2500
199407139 yyyyxh F March 27, 2023, 12:37 p.m. OK GNU C++14 TESTS 59 15 16896000 2500
199611736 0wuming0 F March 29, 2023, 3 a.m. OK GNU C++14 TESTS 59 31 307200 2500
199893479 omeganot F March 30, 2023, 11:57 p.m. OK GNU C++14 TESTS 59 31 1126400 2500
199608775 LXH-cat F March 29, 2023, 1:58 a.m. OK GNU C++14 TESTS 59 31 1638400 2500
199552812 Aleph-zero F March 28, 2023, 2:53 p.m. OK GNU C++14 TESTS 59 31 17408000 2500
199484140 2000030180 F March 28, 2023, 3:22 a.m. OK GNU C++14 TESTS 59 31 18739200 2500
199568900 Seast F March 28, 2023, 5 p.m. OK GNU C++14 TESTS 59 31 74035200 2500
199568840 Seast F March 28, 2023, 5 p.m. OK GNU C++14 TESTS 59 31 74035200 2500
199414507 SergiiGolovko F March 27, 2023, 1:34 p.m. OK GNU C++14 TESTS 59 46 2969600 2500
199802269 D4nnyLee F March 30, 2023, 9:16 a.m. OK GNU C++17 TESTS 59 15 204800 2500
199796784 D4nnyLee F March 30, 2023, 8:14 a.m. OK GNU C++17 TESTS 59 15 204800 2500
199499236 CHARMIPADMAJA F March 28, 2023, 6:57 a.m. OK GNU C++17 TESTS 59 15 204800 2500
199768405 D4nnyLee F March 30, 2023, 12:16 a.m. OK GNU C++17 TESTS 59 15 409600 2500
199623872 Jerry20110434 F March 29, 2023, 6:08 a.m. OK GNU C++17 TESTS 59 15 1126400 2500
199806403 rurixx F March 30, 2023, 10:02 a.m. OK GNU C++17 TESTS 59 15 2048000 2500
199796701 D4nnyLee F March 30, 2023, 8:13 a.m. OK GNU C++17 TESTS 59 30 512000 2500
199521512 Madhu_sudhans7 F March 28, 2023, 10:55 a.m. OK GNU C++17 TESTS 59 30 32972800 2500
199416435 Solashiro F March 27, 2023, 1:48 p.m. OK GNU C++17 TESTS 59 31 512000 2500
199821446 ayersz F March 30, 2023, 12:22 p.m. OK GNU C++17 TESTS 59 31 1126400 2500
199946243 D4nnyLee F March 31, 2023, 12:46 p.m. OK GNU C++17 (64) TESTS 59 15 0 2500
199771434 D4nnyLee F March 30, 2023, 1:27 a.m. OK GNU C++17 (64) TESTS 59 15 0 2500
199466476 nicksms F March 27, 2023, 9:22 p.m. OK GNU C++17 (64) TESTS 59 15 0 2500
199466085 nicksms F March 27, 2023, 9:17 p.m. OK GNU C++17 (64) TESTS 59 15 0 2500
199459723 eriksuenderhauf F March 27, 2023, 8:12 p.m. OK GNU C++17 (64) TESTS 59 15 102400 2500
199710933 Cxny F March 29, 2023, 1:47 p.m. OK GNU C++17 (64) TESTS 59 15 9318400 2500
199633691 Antichain F March 29, 2023, 8:09 a.m. OK GNU C++17 (64) TESTS 59 15 103628800 2500
199600258 birka0 F March 28, 2023, 10:49 p.m. OK GNU C++17 (64) TESTS 59 31 102400 2500
199540365 ExplodingKonjac F March 28, 2023, 1:24 p.m. OK GNU C++17 (64) TESTS 59 31 204800 2500
199579221 michao F March 28, 2023, 6:26 p.m. OK GNU C++17 (64) TESTS 59 31 716800 2500
199576823 1RONMAN F March 28, 2023, 6:03 p.m. OK GNU C++20 (64) TESTS 59 15 102400 2500
199518847 zidder F March 28, 2023, 10:29 a.m. OK GNU C++20 (64) TESTS 59 15 102400 2500
199479240 yangster67 F March 28, 2023, 1:35 a.m. OK GNU C++20 (64) TESTS 59 15 102400 2500
199440627 Nea1 F March 27, 2023, 5 p.m. OK GNU C++20 (64) TESTS 59 15 102400 2500
199418218 Dakovalev1 F March 27, 2023, 2 p.m. OK GNU C++20 (64) TESTS 59 15 102400 2500
199954448 CyberCow F March 31, 2023, 2:05 p.m. OK GNU C++20 (64) TESTS 59 15 204800 2500
199601522 _LeMur_ F March 28, 2023, 11:16 p.m. OK GNU C++20 (64) TESTS 59 15 204800 2500
199541869 sky3141 F March 28, 2023, 1:35 p.m. OK GNU C++20 (64) TESTS 59 15 204800 2500
199539142 psc233 F March 28, 2023, 1:15 p.m. OK GNU C++20 (64) TESTS 59 15 204800 2500
199635259 RGB_ICPC7 F March 29, 2023, 8:27 a.m. OK GNU C++20 (64) TESTS 59 15 716800 2500
199522241 Socrates1232 F March 28, 2023, 11:01 a.m. OK Java 17 TESTS 59 233 716800 2500
199779578 Yuh_03 F March 30, 2023, 4:22 a.m. OK Java 17 TESTS 59 280 20480000 2500
199944983 yvbf F March 31, 2023, 12:34 p.m. OK Java 8 TESTS 59 202 39116800 2500

remove filters

Back to search problems