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 |
---|---|---|---|---|---|---|
1361 | Codeforces Round 647 (Div. 1) - Thanks, Algo Muse! | FINISHED | False | 9000 | 140541899 | June 4, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 3641 ) | B | Johnny and Grandmaster | PROGRAMMING | greedy implementation math sortings | 1900 |
B'Johnny has just found the new, great tutorial: "How to become a grandmaster?". The tutorial tells many strange and unexpected for Johnny things, such as you have to be patient or that very important is solving many harder and harder problems. The boy has found an online judge with tasks divided by topics they cover. He has picked p^{k_i} problems from i -th category ( p is his favorite number). He wants to solve them in two weeks (the patience condition is too hard for Johnny, so for simplicity, he looks only at easy tasks, which can be solved in such a period). Now our future grandmaster has to decide which topics to cover first and which the second week. Help him assign topics in such a way, that workload is balanced. Formally, given n numbers p^{k_i} , the boy wants to divide them into two disjoint sets, minimizing the absolute difference between sums of numbers in each set. Find the minimal absolute difference. Output the result modulo 10^{9}+7 . Input consists of multiple test cases. The first line contains one integer t (1 <= q t <= q 10^5) -- the number of test cases. Each test case is described as follows: The first line contains two integers n and p (1 <= q n, p <= q 10^6) . The second line contains n integers k_i (0 <= q k_i <= q 10^6) . The sum of n over all test cases doesn 't exceed 10^6 . Output one integer -- the reminder of division the answer by 1 ,000 ,000 ,007 . You have to minimize the difference, not it 's remainder. For example, if the minimum difference is equal to 2 , but there is also a distribution where the difference is 10^9 + 8 , then the answer is 2 , not 1 . In the first test case of the example, there 're the following numbers: 4 , 8 , 16 , 16 , and 8 . We can divide them into such two sets: {4, 8, 16} and {8, 16} . Then the difference between the sums of numbers in sets woul'... |
Codeforces Round #647 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
82572835 | Gassa | B | June 4, 2020, 7:20 p.m. | OK | D | TESTS | 44 | 733 | 32460800 | 1900 | |
82538586 | command_block | B | June 4, 2020, 4:01 p.m. | OK | GNU C++11 | TESTS | 42 | 233 | 3891200 | 1900 | |
82602299 | yasugongshang | B | June 5, 2020, 6:30 a.m. | OK | GNU C++11 | TESTS | 44 | 265 | 4096000 | 1900 | |
82584333 | AyoAyowei | B | June 5, 2020, 12:40 a.m. | OK | GNU C++11 | TESTS | 44 | 327 | 7987200 | 1900 | |
82583367 | xumingyang | B | June 5, 2020, 12:04 a.m. | OK | GNU C++11 | TESTS | 44 | 327 | 8089600 | 1900 | |
82538460 | lindongli2004 | B | June 4, 2020, 4 p.m. | OK | GNU C++11 | TESTS | 42 | 342 | 16076800 | 1900 | |
82593680 | hdu_daicon | B | June 5, 2020, 4:23 a.m. | OK | GNU C++11 | TESTS | 44 | 343 | 7987200 | 1900 | |
82583525 | ddytxdy | B | June 5, 2020, 12:11 a.m. | OK | GNU C++11 | TESTS | 44 | 343 | 7987200 | 1900 | |
82666245 | LuoshuiTianyi | B | June 6, 2020, 12:13 a.m. | OK | GNU C++11 | TESTS | 46 | 343 | 53964800 | 1900 | |
82587734 | 2018LZY | B | June 5, 2020, 2:22 a.m. | OK | GNU C++11 | TESTS | 44 | 358 | 3993600 | 1900 | |
82537143 | ouaan | B | June 4, 2020, 3:57 p.m. | OK | GNU C++11 | TESTS | 42 | 358 | 3993600 | 1900 | |
83478289 | Linkus | B | June 11, 2020, 7:38 p.m. | OK | GNU C++14 | TESTS | 46 | 327 | 3993600 | 1900 | |
82693855 | fa_555 | B | June 6, 2020, 10:04 a.m. | OK | GNU C++14 | TESTS | 46 | 358 | 5120000 | 1900 | |
82719311 | practice.pr11 | B | June 6, 2020, 3:46 p.m. | OK | GNU C++14 | TESTS | 46 | 374 | 4300800 | 1900 | |
82594183 | 2020loveme | B | June 5, 2020, 4:33 a.m. | OK | GNU C++14 | TESTS | 44 | 436 | 3993600 | 1900 | |
82780602 | aya_uchida | B | June 7, 2020, 1:04 p.m. | OK | GNU C++14 | TESTS | 46 | 436 | 4300800 | 1900 | |
82509446 | VladProg | B | June 4, 2020, 3:03 p.m. | OK | GNU C++14 | TESTS | 42 | 451 | 7987200 | 1900 | |
82524748 | CodePlatina | B | June 4, 2020, 3:29 p.m. | OK | GNU C++14 | TESTS | 42 | 467 | 3993600 | 1900 | |
82567386 | ainta | B | June 4, 2020, 6:26 p.m. | OK | GNU C++14 | TESTS | 43 | 483 | 8089600 | 1900 | |
82769149 | KisekiPurin2019 | B | June 7, 2020, 10:09 a.m. | OK | GNU C++14 | TESTS | 46 | 514 | 3993600 | 1900 | |
82618345 | Qu0cNguyen | B | June 5, 2020, 9:47 a.m. | OK | GNU C++14 | TESTS | 46 | 514 | 3993600 | 1900 | |
82505099 | LayCurse | B | June 4, 2020, 2:57 p.m. | OK | GNU C++17 | TESTS | 42 | 249 | 102604800 | 1900 | |
82495175 | tourist | B | June 4, 2020, 2:44 p.m. | OK | GNU C++17 | TESTS | 42 | 342 | 3993600 | 1900 | |
82513457 | Rafbill | B | June 4, 2020, 3:09 p.m. | OK | GNU C++17 | TESTS | 42 | 342 | 4300800 | 1900 | |
82530442 | limbo.null | B | June 4, 2020, 3:41 p.m. | OK | GNU C++17 | TESTS | 42 | 374 | 24985600 | 1900 | |
82557202 | hieptk | B | June 4, 2020, 4:52 p.m. | OK | GNU C++17 | TESTS | 42 | 405 | 18739200 | 1900 | |
82510968 | natsugiri | B | June 4, 2020, 3:05 p.m. | OK | GNU C++17 | TESTS | 42 | 420 | 4300800 | 1900 | |
83356131 | _andyli | B | June 11, 2020, 6:57 a.m. | OK | GNU C++17 | TESTS | 46 | 420 | 12492800 | 1900 | |
82548172 | nishant403 | B | June 4, 2020, 4:26 p.m. | OK | GNU C++17 | TESTS | 42 | 421 | 55705600 | 1900 | |
82531052 | amethyst0 | B | June 4, 2020, 3:43 p.m. | OK | GNU C++17 | TESTS | 42 | 436 | 3993600 | 1900 | |
82513261 | dreamoon_love_AA | B | June 4, 2020, 3:09 p.m. | OK | GNU C++17 | TESTS | 42 | 436 | 4505600 | 1900 | |
82543904 | hltk | B | June 4, 2020, 4:14 p.m. | OK | GNU C++17 (64) | TESTS | 42 | 171 | 5120000 | 1900 | |
82741811 | neal | B | June 7, 2020, 12:05 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 233 | 3993600 | 1900 | |
82705484 | Egor.Lifar | B | June 6, 2020, 12:53 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 233 | 3993600 | 1900 | |
82686902 | kimiyuki | B | June 6, 2020, 8:13 a.m. | OK | GNU C++17 (64) | TESTS | 46 | 233 | 3993600 | 1900 | |
82581349 | supersayadilson | B | June 4, 2020, 10:32 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 233 | 7987200 | 1900 | |
82581327 | supersayadilson | B | June 4, 2020, 10:31 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 233 | 7987200 | 1900 | |
82581233 | supersayadilson | B | June 4, 2020, 10:26 p.m. | OK | GNU C++17 (64) | TESTS | 44 | 233 | 7987200 | 1900 | |
82631616 | kvutxdy | B | June 5, 2020, 12:51 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 234 | 7987200 | 1900 | |
82594909 | QMark | B | June 5, 2020, 4:45 a.m. | OK | GNU C++17 (64) | TESTS | 44 | 248 | 7987200 | 1900 | |
82889516 | aurinegro | B | June 7, 2020, 8:56 p.m. | OK | GNU C++17 (64) | TESTS | 46 | 249 | 3993600 | 1900 | |
82568558 | uwi | B | June 4, 2020, 6:34 p.m. | OK | Java 11 | TESTS | 44 | 857 | 4505600 | 1900 | |
82584747 | Lewin | B | June 5, 2020, 12:53 a.m. | OK | Java 11 | TESTS | 44 | 904 | 61849600 | 1900 | |
83377111 | khaufnak | B | June 11, 2020, 11:48 a.m. | OK | Java 11 | TESTS | 46 | 1075 | 17817600 | 1900 | |
82528895 | PizzaLovers007 | B | June 4, 2020, 3:38 p.m. | OK | Java 11 | TESTS | 42 | 1778 | 69017600 | 1900 | |
82572640 | iceburst | B | June 4, 2020, 7:18 p.m. | OK | Java 8 | TESTS | 44 | 685 | 7065600 | 1900 | |
82581821 | DarLam | B | June 4, 2020, 10:54 p.m. | OK | Java 8 | TESTS | 44 | 686 | 37888000 | 1900 | |
82521076 | StayAwayFromBitches | B | June 4, 2020, 3:22 p.m. | OK | Java 8 | TESTS | 42 | 717 | 39116800 | 1900 | |
82897993 | AnandOza | B | June 8, 2020, 1:50 a.m. | OK | Java 8 | TESTS | 46 | 733 | 37785600 | 1900 | |
82664549 | polyakoff | B | June 5, 2020, 10:45 p.m. | OK | Java 8 | TESTS | 46 | 764 | 37580800 | 1900 | |
82596935 | ahmadhoumani | B | June 5, 2020, 5:18 a.m. | OK | Java 8 | TESTS | 44 | 779 | 37580800 | 1900 | |
82664515 | polyakoff | B | June 5, 2020, 10:43 p.m. | OK | Java 8 | TESTS | 46 | 780 | 37580800 | 1900 | |
82537814 | polyakoff | B | June 4, 2020, 3:59 p.m. | OK | Java 8 | TESTS | 42 | 826 | 37580800 | 1900 | |
82548839 | qlf9 | B | June 4, 2020, 4:28 p.m. | OK | Java 8 | TESTS | 42 | 842 | 40960000 | 1900 | |
82535656 | cwise | B | June 4, 2020, 3:54 p.m. | OK | Java 8 | TESTS | 42 | 872 | 19456000 | 1900 | |
83263988 | Spheniscine | B | June 10, 2020, 3:14 a.m. | OK | Kotlin | TESTS | 46 | 577 | 1126400 | 1900 | |
83263838 | Spheniscine | B | June 10, 2020, 3:10 a.m. | OK | Kotlin | TESTS | 46 | 577 | 1126400 | 1900 | |
83263636 | Spheniscine | B | June 10, 2020, 3:05 a.m. | OK | Kotlin | TESTS | 46 | 577 | 1126400 | 1900 | |
82587288 | Spheniscine | B | June 5, 2020, 2:10 a.m. | OK | Kotlin | TESTS | 44 | 794 | 23142400 | 1900 | |
82601122 | Spheniscine | B | June 5, 2020, 6:16 a.m. | OK | Kotlin | TESTS | 44 | 810 | 1126400 | 1900 | |
82600471 | Spheniscine | B | June 5, 2020, 6:09 a.m. | OK | Kotlin | TESTS | 44 | 810 | 1126400 | 1900 | |
82587792 | Spheniscine | B | June 5, 2020, 2:23 a.m. | OK | Kotlin | TESTS | 44 | 811 | 23244800 | 1900 | |
82598423 | Spheniscine | B | June 5, 2020, 5:41 a.m. | OK | Kotlin | TESTS | 44 | 841 | 23654400 | 1900 | |
82602845 | Spheniscine | B | June 5, 2020, 6:36 a.m. | OK | Kotlin | TESTS | 44 | 857 | 1126400 | 1900 | |
82507257 | Tlatoani | B | June 4, 2020, 3 p.m. | OK | Kotlin | TESTS | 42 | 1060 | 107008000 | 1900 | |
82562930 | nehan_der_thal | B | June 4, 2020, 5:04 p.m. | OK | Mono C# | TESTS | 42 | 998 | 195993600 | 1900 | |
82513673 | keymoon | B | June 4, 2020, 3:09 p.m. | OK | Mono C# | TESTS | 42 | 1653 | 170393600 | 1900 | |
82579193 | lxhgww | B | June 4, 2020, 9:25 p.m. | OK | MS C++ | TESTS | 44 | 561 | 3993600 | 1900 | |
83135086 | Vedensky | B | June 8, 2020, 12:37 p.m. | OK | MS C++ 2017 | TESTS | 46 | 561 | 10035200 | 1900 | |
82582040 | tarattata1 | B | June 4, 2020, 11:05 p.m. | OK | MS C++ 2017 | TESTS | 44 | 1013 | 32358400 | 1900 | |
82541209 | Seyaua | B | June 4, 2020, 4:08 p.m. | OK | MS C++ 2017 | TESTS | 42 | 1169 | 4300800 | 1900 | |
82535965 | alex_36 | B | June 4, 2020, 3:54 p.m. | OK | MS C++ 2017 | TESTS | 42 | 1403 | 47206400 | 1900 | |
82572789 | BpeMeHHa91_TryDHocTb | B | June 4, 2020, 7:19 p.m. | OK | MS C++ 2017 | TESTS | 44 | 1434 | 22220800 | 1900 | |
82518768 | Pasqual45 | B | June 4, 2020, 3:18 p.m. | OK | MS C++ 2017 | TESTS | 42 | 1450 | 12083200 | 1900 | |
82530342 | P___ | B | June 4, 2020, 3:41 p.m. | OK | MS C++ 2017 | TESTS | 42 | 1793 | 72806400 | 1900 | |
82648409 | gintoki_s | B | June 5, 2020, 4:35 p.m. | OK | PyPy 3 | TESTS | 46 | 717 | 60928000 | 1900 | |
82637126 | aberent | B | June 5, 2020, 2:06 p.m. | OK | PyPy 3 | TESTS | 46 | 858 | 61132800 | 1900 | |
82697733 | codershuvo | B | June 6, 2020, 11:02 a.m. | OK | PyPy 3 | TESTS | 46 | 1200 | 70553600 | 1900 | |
82511100 | conqueror_of_tourist | B | June 4, 2020, 3:05 p.m. | OK | PyPy 3 | TESTS | 42 | 1216 | 71270400 | 1900 | |
82552022 | neterukun | B | June 4, 2020, 4:37 p.m. | OK | PyPy 3 | TESTS | 42 | 1262 | 60928000 | 1900 | |
82696182 | codershuvo | B | June 6, 2020, 10:39 a.m. | OK | PyPy 3 | TESTS | 46 | 1279 | 70758400 | 1900 | |
82528091 | titia | B | June 4, 2020, 3:36 p.m. | OK | PyPy 3 | TESTS | 42 | 1294 | 70553600 | 1900 | |
82611161 | Nit1n | B | June 5, 2020, 8:18 a.m. | OK | PyPy 3 | TESTS | 45 | 1310 | 70860800 | 1900 | |
82610185 | Nit1n | B | June 5, 2020, 8:07 a.m. | OK | PyPy 3 | TESTS | 45 | 1325 | 70553600 | 1900 | |
82610977 | Nit1n | B | June 5, 2020, 8:16 a.m. | OK | PyPy 3 | TESTS | 45 | 1325 | 70963200 | 1900 | |
82670272 | user202729_ | B | June 6, 2020, 3:01 a.m. | OK | Rust | TESTS | 46 | 296 | 3993600 | 1900 | |
82517797 | EbTech | B | June 4, 2020, 3:16 p.m. | OK | Rust | TESTS | 42 | 405 | 25395200 | 1900 | |
82515046 | sansen | B | June 4, 2020, 3:12 p.m. | OK | Rust | TESTS | 42 | 421 | 20377600 | 1900 |
Back to search problems