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 |
|---|---|---|---|---|---|---|
| 830 | Codeforces Round 424 (Div. 1, rated, based on VK Cup Finals) | FINISHED | False | 7200 | 276447323 | July 13, 2017, 3:05 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 338 ) | E | Perpetual Motion Machine | PROGRAMMING | constructive algorithms dp graphs implementation math trees | 3100 |
Developer Petr thinks that he invented a perpetual motion machine. Namely, he has a lot of elements , which work in the following way. Each element has one controller that can be set to any non-negative real value. If a controller is set on some value x , then the controller consumes x 2 energy units per second. At the same time, any two elements connected by a wire produce y · z energy units per second, where y and z are the values set on their controllers. Petr has only a limited number of wires, so he has already built some scheme of elements and wires, and is now interested if it's possible to set the controllers in such a way that the system produces at least as much power as it consumes, and at least one controller is set on the value different from 0 . Help him check this, and if it's possible, find the required integer values that should be set. It is guaranteed that if there exist controllers' settings satisfying the above conditions, then there exist required integer values not greater than 10 6 . There are several (at least one) test cases in the input. The first line contains single integer — the number of test cases. There is an empty line before each test case. The first line of test case contains two integers n and m ( 1 ≤ n ≤ 10 5 , 0 ≤ m ≤ 10 5 ) — the number of elements in the scheme and the number of wires. After that, m lines follow, each of them contains two integers a and b ( 1 ≤ a , b ≤ n ) — two elements connected by a wire. No element is connected with itself, no two elements are connected by more than one wire. It is guaranteed that the sum of n and the sum of m over all test cases do not exceed 10 5 . For hacks you can only use tests with one test case. Print answer for each test case. For each test case print " YES " if it's possible to set the controllers in such a way that the consumed power is not greater than the power produced, and the required values on the next line. The settings should be integers from 0 to 10 6 , inclus |
| Codeforces Round #424 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 30766927 | Magolor | E | Sept. 27, 2017, 3:39 a.m. | OK | GNU C++ | TESTS | 23 | 30 | 9420800 | 3100 | |
| 40980479 | ReaLNero1 | E | July 30, 2018, 5:32 p.m. | OK | GNU C++ | TESTS | 23 | 46 | 9420800 | 3100 | |
| 30766935 | vjudge2 | E | Sept. 27, 2017, 3:40 a.m. | OK | GNU C++ | TESTS | 23 | 46 | 9420800 | 3100 | |
| 30766887 | Magolor | E | Sept. 27, 2017, 3:36 a.m. | OK | GNU C++ | TESTS | 23 | 61 | 10035200 | 3100 | |
| 36776138 | Worldwide_D | E | March 31, 2018, 2:09 p.m. | OK | GNU C++ | TESTS | 23 | 62 | 15667200 | 3100 | |
| 30389448 | F.Darcy | E | Sept. 16, 2017, 5:36 p.m. | OK | GNU C++ | TESTS | 23 | 93 | 15769600 | 3100 | |
| 28520175 | Baklazan | E | July 13, 2017, 4:25 p.m. | OK | GNU C++ | TESTS | 23 | 124 | 8908800 | 3100 | |
| 28553853 | Tanha | E | July 14, 2017, 5:01 p.m. | OK | GNU C++ | TESTS | 23 | 124 | 18124800 | 3100 | |
| 28520619 | 248926 | E | July 13, 2017, 4:29 p.m. | OK | GNU C++ | TESTS | 23 | 124 | 18124800 | 3100 | |
| 28597377 | itfox0905 | E | July 16, 2017, 1:38 p.m. | OK | GNU C++ | TESTS | 23 | 295 | 15872000 | 3100 | |
| 46970392 | Itst | E | Dec. 13, 2018, 1:32 p.m. | OK | GNU C++11 | TESTS | 23 | 46 | 7168000 | 3100 | |
| 57643423 | xgzc | E | July 24, 2019, 1:23 p.m. | OK | GNU C++11 | TESTS | 23 | 46 | 7372800 | 3100 | |
| 46970340 | Itst | E | Dec. 13, 2018, 1:30 p.m. | OK | GNU C++11 | TESTS | 23 | 46 | 7577600 | 3100 | |
| 58062311 | luogu_bot4 | E | July 31, 2019, 7:50 a.m. | OK | GNU C++11 | TESTS | 23 | 46 | 12185600 | 3100 | |
| 58061488 | luogu_bot2 | E | July 31, 2019, 7:34 a.m. | OK | GNU C++11 | TESTS | 23 | 46 | 12185600 | 3100 | |
| 54504468 | WOSHIGEPACHONG2 | E | May 23, 2019, 2:23 a.m. | OK | GNU C++11 | TESTS | 23 | 61 | 7168000 | 3100 | |
| 57769467 | py_ultron | E | July 25, 2019, 11:12 p.m. | OK | GNU C++11 | TESTS | 23 | 61 | 7782400 | 3100 | |
| 31507922 | shanquan2 | E | Oct. 19, 2017, 12:37 p.m. | OK | GNU C++11 | TESTS | 23 | 61 | 9932800 | 3100 | |
| 57873923 | lopare | E | July 28, 2019, 3:56 a.m. | OK | GNU C++11 | TESTS | 23 | 62 | 7782400 | 3100 | |
| 68342829 | mocania | E | Jan. 7, 2020, 5:15 a.m. | OK | GNU C++11 | TESTS | 23 | 77 | 10444800 | 3100 | |
| 29375970 | Hank2006 | E | Aug. 12, 2017, 11:27 a.m. | OK | GNU C++14 | TESTS | 23 | 77 | 10137600 | 3100 | |
| 32354487 | Keracy | E | Nov. 16, 2017, 12:14 p.m. | OK | GNU C++14 | TESTS | 23 | 78 | 8192000 | 3100 | |
| 28541442 | RNS_JKS | E | July 14, 2017, 7:36 a.m. | OK | GNU C++14 | TESTS | 23 | 78 | 11161600 | 3100 | |
| 28672428 | irkstepanov | E | July 18, 2017, 3:33 p.m. | OK | GNU C++14 | TESTS | 23 | 78 | 11264000 | 3100 | |
| 59505919 | Scut82 | E | Aug. 26, 2019, 6:05 a.m. | OK | GNU C++14 | TESTS | 23 | 93 | 5222400 | 3100 | |
| 28546749 | NiroBC | E | July 14, 2017, 11:27 a.m. | OK | GNU C++14 | TESTS | 23 | 93 | 7475200 | 3100 | |
| 43551708 | duweihua | E | Sept. 29, 2018, 1:27 a.m. | OK | GNU C++14 | TESTS | 23 | 93 | 8396800 | 3100 | |
| 33912975 | abeker | E | Jan. 5, 2018, 12:08 a.m. | OK | GNU C++14 | TESTS | 23 | 93 | 10649600 | 3100 | |
| 59500378 | Scut82 | E | Aug. 26, 2019, 2:21 a.m. | OK | GNU C++14 | TESTS | 23 | 93 | 11059200 | 3100 | |
| 28572121 | Batman | E | July 15, 2017, 11:41 a.m. | OK | GNU C++14 | TESTS | 23 | 93 | 12902400 | 3100 | |
| 51379061 | Shayan.P | E | March 16, 2019, 3:24 p.m. | OK | GNU C++17 | TESTS | 23 | 93 | 10547200 | 3100 | |
| 57297045 | Benq | E | July 18, 2019, 7:55 p.m. | OK | GNU C++17 | TESTS | 23 | 93 | 11059200 | 3100 | |
| 68567612 | SHZhang2 | E | Jan. 10, 2020, 10:47 p.m. | OK | GNU C++17 | TESTS | 23 | 109 | 12288000 | 3100 | |
| 29700526 | Darth_Jar_Jar_Binks | E | Aug. 23, 2017, 7:33 a.m. | OK | Java 8 | TESTS | 23 | 218 | 6041600 | 3100 | |
| 28648444 | mmaxio | E | July 17, 2017, 8:22 p.m. | OK | Java 8 | TESTS | 23 | 218 | 30515200 | 3100 | |
| 28526547 | Petr | E | July 13, 2017, 5:59 p.m. | OK | Java 8 | TESTS | 23 | 529 | 63180800 | 3100 | |
| 28526174 | Petr | E | July 13, 2017, 5:51 p.m. | OK | Java 8 | TESTS | 23 | 545 | 63078400 | 3100 | |
| 28543839 | Los_Angelos_Laycurse | E | July 14, 2017, 9:09 a.m. | OK | MS C++ | TESTS | 23 | 93 | 8192000 | 3100 |
Back to search problems