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 |
---|---|---|---|---|---|---|
1242 | Codeforces Round 599 (Div. 1) | FINISHED | False | 7200 | 158770499 | Nov. 6, 2019, 3:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1682 ) | C | Sum Balance | PROGRAMMING | bitmasks dfs and similar dp graphs | 2400 |
B'Ujan has a lot of numbers in his boxes. He likes order and balance, so he decided to reorder the numbers. There are k boxes numbered from 1 to k . The i -th box contains n_i integer numbers. The integers can be negative. All of the integers are distinct. Ujan is lazy, so he will do the following reordering of the numbers exactly once. He will pick a single integer from each of the boxes, k integers in total. Then he will insert the chosen numbers -- one integer in each of the boxes, so that the number of integers in each box is the same as in the beginning. Note that he may also insert an integer he picked from a box back into the same box. Ujan will be happy if the sum of the integers in each box is the same. Can he achieve this and make the boxes perfectly balanced, like all things should be? The first line contains a single integer k ( 1 <= q k <= q 15 ), the number of boxes. The i -th of the next k lines first contains a single integer n_i ( 1 <= q n_i <= q 5 ,000 ), the number of integers in box i . Then the same line contains n_i integers a_{i,1}, ldots, a_{i,n_i} ( |a_{i,j}| <= q 10^9 ), the integers in the i -th box. It is guaranteed that all a_{i,j} are distinct. If Ujan cannot achieve his goal, output "No" in a single line. Otherwise in the first line output "Yes", and then output k lines. The i -th of these lines should contain two integers c_i and p_i . This means that Ujan should pick the integer c_i from the i -th box and place it in the p_i -th box afterwards. If there are multiple solutions, output any of those. You can print each letter in any case (upper or lower). In the first sample, Ujan can put the number 7 in the 2 nd box, the number 2 in the 3 rd box, the number 5 in the 1 st box and keep the number 10 in the same 4 th box. Then the boxes will contain'... |
Codeforces Round #599 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
64403825 | Gassa | C | Nov. 6, 2019, 4:20 p.m. | OK | D | TESTS | 77 | 171 | 11776000 | 2400 | |
64387430 | hos.lyric | C | Nov. 6, 2019, 3:35 p.m. | OK | D | TESTS | 77 | 358 | 22528000 | 2400 | |
67602270 | poaspoas | C | Dec. 25, 2019, 12:22 p.m. | OK | GNU C++11 | TESTS | 78 | 46 | 1945600 | 2400 | |
69939928 | fpdqwq | C | Feb. 1, 2020, 5:46 a.m. | OK | GNU C++11 | TESTS | 78 | 62 | 3891200 | 2400 | |
64664207 | XY_cpp | C | Nov. 11, 2019, 12:07 a.m. | OK | GNU C++11 | TESTS | 78 | 62 | 3891200 | 2400 | |
64450013 | dysyn1314 | C | Nov. 7, 2019, 6:43 a.m. | OK | GNU C++11 | TESTS | 77 | 62 | 10137600 | 2400 | |
64468955 | Seast | C | Nov. 7, 2019, 12:32 p.m. | OK | GNU C++11 | TESTS | 77 | 62 | 27750400 | 2400 | |
64517566 | guyan | C | Nov. 8, 2019, 11:16 a.m. | OK | GNU C++11 | TESTS | 78 | 62 | 29286400 | 2400 | |
64420590 | sam721 | C | Nov. 6, 2019, 5:48 p.m. | OK | GNU C++11 | TESTS | 77 | 77 | 5120000 | 2400 | |
65697256 | Dancepted | C | Nov. 25, 2019, 8:55 a.m. | OK | GNU C++11 | TESTS | 78 | 78 | 8396800 | 2400 | |
65795058 | Sodaine | C | Nov. 27, 2019, 3:44 a.m. | OK | GNU C++11 | TESTS | 78 | 78 | 27750400 | 2400 | |
64479950 | 2016wudi | C | Nov. 7, 2019, 3:36 p.m. | OK | GNU C++11 | TESTS | 78 | 93 | 1843200 | 2400 | |
64718636 | bzh | C | Nov. 12, 2019, 1:22 a.m. | OK | GNU C++14 | TESTS | 78 | 78 | 1331200 | 2400 | |
64489547 | antguz | C | Nov. 7, 2019, 7:16 p.m. | OK | GNU C++14 | TESTS | 78 | 78 | 2457600 | 2400 | |
64417046 | boba5551 | C | Nov. 6, 2019, 5:02 p.m. | OK | GNU C++14 | TESTS | 77 | 78 | 5017600 | 2400 | |
64422199 | kazuma | C | Nov. 6, 2019, 6:06 p.m. | OK | GNU C++14 | TESTS | 77 | 78 | 7372800 | 2400 | |
64450758 | farmerboy | C | Nov. 7, 2019, 7 a.m. | OK | GNU C++14 | TESTS | 77 | 93 | 2969600 | 2400 | |
64412379 | KNB. | C | Nov. 6, 2019, 4:47 p.m. | OK | GNU C++14 | TESTS | 77 | 93 | 3276800 | 2400 | |
64727665 | HIR180 | C | Nov. 12, 2019, 7:06 a.m. | OK | GNU C++14 | TESTS | 78 | 93 | 5120000 | 2400 | |
66788558 | 2005 | C | Dec. 13, 2019, 2:29 p.m. | OK | GNU C++14 | TESTS | 78 | 93 | 6451200 | 2400 | |
64798545 | atodo | C | Nov. 13, 2019, 1:45 p.m. | OK | GNU C++14 | TESTS | 78 | 93 | 9318400 | 2400 | |
66169118 | bhaag_milkha | C | Dec. 2, 2019, 9:21 a.m. | OK | GNU C++14 | TESTS | 78 | 93 | 10547200 | 2400 | |
64492122 | esrever | C | Nov. 7, 2019, 8:35 p.m. | OK | GNU C++17 | TESTS | 78 | 77 | 3379200 | 2400 | |
64492337 | esrever | C | Nov. 7, 2019, 8:43 p.m. | OK | GNU C++17 | TESTS | 78 | 78 | 2355200 | 2400 | |
64492054 | esrever | C | Nov. 7, 2019, 8:33 p.m. | OK | GNU C++17 | TESTS | 78 | 78 | 3379200 | 2400 | |
64454218 | pperm | C | Nov. 7, 2019, 8:10 a.m. | OK | GNU C++17 | TESTS | 77 | 78 | 3788800 | 2400 | |
64410441 | kilotaras | C | Nov. 6, 2019, 4:41 p.m. | OK | GNU C++17 | TESTS | 77 | 78 | 3788800 | 2400 | |
64627364 | user202729_ | C | Nov. 10, 2019, 8:59 a.m. | OK | GNU C++17 | TESTS | 78 | 78 | 3993600 | 2400 | |
64559691 | Z3L5M | C | Nov. 9, 2019, 5:33 a.m. | OK | GNU C++17 | TESTS | 78 | 78 | 4608000 | 2400 | |
64426349 | C21 | C | Nov. 6, 2019, 7:19 p.m. | OK | GNU C++17 | TESTS | 77 | 78 | 5222400 | 2400 | |
64423235 | esrever | C | Nov. 6, 2019, 6:22 p.m. | OK | GNU C++17 | TESTS | 77 | 78 | 5632000 | 2400 | |
64405829 | INVWVZ | C | Nov. 6, 2019, 4:26 p.m. | OK | GNU C++17 | TESTS | 77 | 78 | 6451200 | 2400 | |
64399051 | uwi | C | Nov. 6, 2019, 4:05 p.m. | OK | Java 8 | TESTS | 77 | 171 | 0 | 2400 | |
66602059 | beginner1010 | C | Dec. 10, 2019, 4:54 p.m. | OK | Java 8 | TESTS | 78 | 264 | 0 | 2400 | |
64422134 | fetetriste | C | Nov. 6, 2019, 6:05 p.m. | OK | Java 8 | TESTS | 77 | 265 | 0 | 2400 | |
64422086 | fetetriste | C | Nov. 6, 2019, 6:04 p.m. | OK | Java 8 | TESTS | 77 | 265 | 0 | 2400 | |
64857097 | beroul | C | Nov. 14, 2019, 12:08 a.m. | OK | Java 8 | TESTS | 78 | 280 | 0 | 2400 | |
64407966 | Harpae | C | Nov. 6, 2019, 4:33 p.m. | OK | Java 8 | TESTS | 77 | 280 | 0 | 2400 | |
64604984 | xodiac | C | Nov. 9, 2019, 8:05 p.m. | OK | Java 8 | TESTS | 78 | 296 | 1843200 | 2400 | |
64857125 | beroul | C | Nov. 14, 2019, 12:11 a.m. | OK | Java 8 | TESTS | 78 | 311 | 0 | 2400 | |
64443351 | badprogrammer123 | C | Nov. 7, 2019, 5:29 a.m. | OK | Java 8 | TESTS | 77 | 311 | 0 | 2400 | |
64857087 | beroul | C | Nov. 14, 2019, 12:08 a.m. | OK | Java 8 | TESTS | 78 | 374 | 0 | 2400 | |
64407121 | Tlatoani | C | Nov. 6, 2019, 4:30 p.m. | OK | Kotlin | TESTS | 77 | 467 | 16486400 | 2400 | |
64437119 | AlexanderL | C | Nov. 7, 2019, 2:05 a.m. | OK | MS C++ 2017 | TESTS | 77 | 124 | 2457600 | 2400 | |
64436637 | AlexanderL | C | Nov. 7, 2019, 1:47 a.m. | OK | MS C++ 2017 | TESTS | 77 | 124 | 2560000 | 2400 | |
65110077 | Infoshoc | C | Nov. 15, 2019, 9:41 p.m. | OK | PyPy 3 | TESTS | 78 | 343 | 17510400 | 2400 | |
65110013 | Infoshoc | C | Nov. 15, 2019, 9:39 p.m. | OK | PyPy 3 | TESTS | 78 | 421 | 17715200 | 2400 | |
65297469 | sonlh07 | C | Nov. 18, 2019, 12:03 p.m. | OK | PyPy 3 | TESTS | 78 | 514 | 14848000 | 2400 | |
67456842 | ratatat | C | Dec. 23, 2019, 7:17 a.m. | OK | PyPy 3 | TESTS | 78 | 795 | 16179200 | 2400 | |
67409165 | ratatat | C | Dec. 22, 2019, 7:38 a.m. | OK | PyPy 3 | TESTS | 78 | 857 | 14131200 | 2400 | |
64850788 | DarLam | C | Nov. 13, 2019, 7:31 p.m. | OK | PyPy 3 | TESTS | 78 | 857 | 17817600 | 2400 | |
64483969 | DarLam | C | Nov. 7, 2019, 5 p.m. | OK | PyPy 3 | TESTS | 78 | 873 | 17817600 | 2400 | |
64507593 | DarLam | C | Nov. 8, 2019, 7:32 a.m. | OK | PyPy 3 | TESTS | 78 | 997 | 17100800 | 2400 | |
68123402 | gearjack | C | Jan. 3, 2020, 2:12 p.m. | OK | Rust | TESTS | 78 | 93 | 9625600 | 2400 | |
64486979 | yoshrc | C | Nov. 7, 2019, 6:10 p.m. | OK | Rust | TESTS | 78 | 93 | 11878400 | 2400 | |
64486931 | yoshrc | C | Nov. 7, 2019, 6:09 p.m. | OK | Rust | TESTS | 78 | 124 | 5632000 | 2400 | |
66082709 | sansen | C | Dec. 1, 2019, 1:44 a.m. | OK | Rust | TESTS | 78 | 155 | 3686400 | 2400 |
Back to search problems