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 |
---|---|---|---|---|---|---|
850 | Codeforces Round 432 (Div. 1, based on IndiaHacks Final Round 2017) | FINISHED | False | 9000 | 227287499 | Sept. 4, 2017, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 393 ) | D | Tournament Construction | PROGRAMMING | constructive algorithms dp graphs greedy math | 2700 |
B'Ivan is reading a book about tournaments. He knows that a tournament is an oriented graph with exactly one oriented edge between each pair of vertices. The score of a vertex is the number of edges going outside this vertex. Yesterday Ivan learned Landau 's criterion: there is tournament with scores d1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89d2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89... xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89dn if and only if for all 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89< xe2 x80 x89n and . Now, Ivan wanna solve following problem: given a set of numbers S xe2 x80 x89= xe2 x80 x89{a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89am}, is there a tournament with given set of scores? I.e. is there tournament with sequence of scores d1, xe2 x80 x89d2, xe2 x80 x89..., xe2 x80 x89dn such that if we remove duplicates in scores, we obtain the required set {a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89am}? Find a tournament with minimum possible number of vertices. The first line contains a single integer m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8931). The next line contains m distinct integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89am (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8930) -- elements of the set S. It is guaranteed that all elements of the set are distinct. If there are no such tournaments, print string "=(" (without quotes). Otherwise, print an integer n -- the number of vertices in the tournament. Then print n lines with n characters -- matrix of the tournament. The j-th element in the i-th row should be 1 if the edge between the i-th and the j-th vertices is oriented towards the j-th vertex, and 0 otherwise. The main diagonal should contain only zeros. '... |
Codeforces Round #432 editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
30609414 | black_horse2014 | D | Sept. 22, 2017, 8:34 a.m. | OK | GNU C++ | TESTS | 130 | 15 | 6553600 | 2700 | |
30566528 | kut_ksr1994 | D | Sept. 21, 2017, 3:55 a.m. | OK | GNU C++ | TESTS | 130 | 15 | 19046400 | 2700 | |
30182295 | zyb | D | Sept. 7, 2017, 1:22 p.m. | OK | GNU C++ | TESTS | 130 | 15 | 166502400 | 2700 | |
30222572 | F.Darcy | D | Sept. 9, 2017, 10:06 a.m. | OK | GNU C++ | TESTS | 130 | 30 | 24371200 | 2700 | |
36787897 | mxh1999 | D | April 1, 2018, 4:30 a.m. | OK | GNU C++ | TESTS | 130 | 30 | 26112000 | 2700 | |
30215000 | laofudasuan | D | Sept. 9, 2017, 12:52 a.m. | OK | GNU C++ | TESTS | 130 | 30 | 28262400 | 2700 | |
30078310 | faebdc | D | Sept. 4, 2017, 4:48 p.m. | OK | GNU C++ | TESTS | 130 | 31 | 2048000 | 2700 | |
30078194 | nhho | D | Sept. 4, 2017, 4:47 p.m. | OK | GNU C++ | TESTS | 130 | 31 | 3993600 | 2700 | |
30101681 | MemS | D | Sept. 5, 2017, 2:06 p.m. | OK | GNU C++ | TESTS | 130 | 31 | 20582400 | 2700 | |
32000597 | jizhixiaowangzi | D | Nov. 3, 2017, 7:59 a.m. | OK | GNU C++ | TESTS | 130 | 31 | 32358400 | 2700 | |
30093362 | yfzcsc | D | Sept. 5, 2017, 7:29 a.m. | OK | GNU C++11 | TESTS | 130 | 15 | 1843200 | 2700 | |
30074690 | Radewoosh | D | Sept. 4, 2017, 4:18 p.m. | OK | GNU C++11 | TESTS | 130 | 15 | 3993600 | 2700 | |
30124464 | wust_hee | D | Sept. 6, 2017, 6:47 a.m. | OK | GNU C++11 | TESTS | 130 | 15 | 4608000 | 2700 | |
30124289 | wust_hee | D | Sept. 6, 2017, 6:37 a.m. | OK | GNU C++11 | TESTS | 130 | 15 | 4608000 | 2700 | |
34974036 | snowflake | D | Feb. 6, 2018, 2:41 p.m. | OK | GNU C++11 | TESTS | 130 | 15 | 10444800 | 2700 | |
30090545 | rqgao2014 | D | Sept. 5, 2017, 4:48 a.m. | OK | GNU C++11 | TESTS | 130 | 15 | 18022400 | 2700 | |
30308458 | dy0607 | D | Sept. 13, 2017, 1:43 p.m. | OK | GNU C++11 | TESTS | 130 | 15 | 19251200 | 2700 | |
30180092 | PEDY4000 | D | Sept. 7, 2017, 11:52 a.m. | OK | GNU C++11 | TESTS | 130 | 15 | 20992000 | 2700 | |
30086253 | 860579 | D | Sept. 4, 2017, 11:12 p.m. | OK | GNU C++11 | TESTS | 130 | 30 | 5529600 | 2700 | |
30077662 | matthew99 | D | Sept. 4, 2017, 4:43 p.m. | OK | GNU C++11 | TESTS | 130 | 30 | 8396800 | 2700 | |
30093026 | apiadu | D | Sept. 5, 2017, 7:13 a.m. | OK | GNU C++14 | TESTS | 130 | 15 | 11980800 | 2700 | |
30098788 | tun | D | Sept. 5, 2017, 12:15 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 17408000 | 2700 | |
30098565 | tun | D | Sept. 5, 2017, 12:03 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 17408000 | 2700 | |
30073634 | nguyenthibanh | D | Sept. 4, 2017, 4:10 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 17408000 | 2700 | |
30285429 | FDKevin | D | Sept. 12, 2017, 12:02 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 20582400 | 2700 | |
30075318 | Anadi | D | Sept. 4, 2017, 4:24 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 20992000 | 2700 | |
30910865 | jufusong | D | Oct. 1, 2017, 2:04 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 27340800 | 2700 | |
30073929 | --d | D | Sept. 4, 2017, 4:12 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 27443200 | 2700 | |
30073606 | imaxblue | D | Sept. 4, 2017, 4:10 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 39833600 | 2700 | |
30073378 | Nebuchadnezzar | D | Sept. 4, 2017, 4:08 p.m. | OK | GNU C++14 | TESTS | 130 | 15 | 73318400 | 2700 | |
63198007 | Kuroni | D | Oct. 22, 2019, 7:17 p.m. | OK | GNU C++17 | TESTS | 130 | 31 | 3993600 | 2700 | |
66560943 | Martin53 | D | Dec. 9, 2019, 6:53 p.m. | OK | GNU C++17 | TESTS | 130 | 31 | 4198400 | 2700 | |
47000679 | ShichengXiao | D | Dec. 14, 2018, 11:24 a.m. | OK | GNU C++17 | TESTS | 130 | 31 | 12083200 | 2700 | |
62590710 | Umi | D | Oct. 14, 2019, 8:58 p.m. | OK | GNU C++17 | TESTS | 130 | 31 | 16281600 | 2700 | |
55717858 | kefaa2 | D | June 18, 2019, 1:39 p.m. | OK | GNU C++17 | TESTS | 130 | 31 | 44748800 | 2700 | |
68466067 | icecuber | D | Jan. 9, 2020, 8:26 p.m. | OK | GNU C++17 | TESTS | 130 | 31 | 74752000 | 2700 | |
66775891 | justfocusplease | D | Dec. 13, 2019, 10:01 a.m. | OK | GNU C++17 | TESTS | 130 | 31 | 86016000 | 2700 | |
44075463 | zjp_shadow | D | Oct. 10, 2018, 12:54 p.m. | OK | GNU C++17 | TESTS | 130 | 46 | 1740800 | 2700 | |
63283471 | isaf27 | D | Oct. 24, 2019, 9:29 a.m. | OK | GNU C++17 | TESTS | 130 | 46 | 12083200 | 2700 | |
62255008 | ivan100sic | D | Oct. 10, 2019, 10:31 a.m. | OK | GNU C++17 | TESTS | 130 | 46 | 30003200 | 2700 | |
30075682 | mmaxio | D | Sept. 4, 2017, 4:27 p.m. | OK | Java 8 | TESTS | 130 | 124 | 0 | 2700 | |
30841393 | uwi | D | Sept. 29, 2017, 9:12 p.m. | OK | Java 8 | TESTS | 130 | 140 | 0 | 2700 | |
30088620 | waltz | D | Sept. 5, 2017, 2:26 a.m. | OK | MS C++ | TESTS | 130 | 31 | 9318400 | 2700 |
Back to search problems