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 |
|---|---|---|---|---|---|---|
| 2068 | European Championship 2025 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 35493923 | March 2, 2025, 10:35 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 993 ) | A | Condorcet Elections | PROGRAMMING | constructive algorithms graphs probabilities |
It is a municipality election year. Even though the leader of the country has not changed for two decades, the elections are always transparent and fair. There are (n) political candidates, numbered from (1) to (n), contesting the right to govern. The elections happen using a variation of the Ranked Voting System . In their ballot, each voter will rank all (n) candidates from most preferable to least preferable. That is, each vote is a permutation of (\{1, 2, \ldots, n\}), where the first element of the permutation corresponds to the most preferable candidate. We say that candidate (a) defeats candidate (b) if in more than half of the votes candidate (a) is more preferable than candidate (b). As the election is fair and transparent, the state television has already decreed a list of (m) facts—the (i)-th fact being "candidate (a_i) has defeated candidate (b_i)"—all before the actual election! You are in charge of the election commission and tallying up the votes. You need to present a list of votes that produces the outcome advertised on television, or to determine that it is not possible. However, you are strongly encouraged to find a solution, or you might upset higher-ups. The first line contains integers (n) and (m) ((2 \le n \le 50), (1 \le m \le \frac{n(n-1)}{2})) — the number of parties and the number of pairs with known election outcomes. The (i)-th of the following (m) lines contains two integers (a_i) and (b_i) ((1 \le a_i, b_i \le n), (a_i \ne b_i)) — candidate (a_i) defeats candidate (b_i). Each unordered pair (\{a_i, b_i\}) is given at most once. Print (YES) if there is a list of votes matching the facts advertised on television. Otherwise, print (NO). If there is a valid list of votes, print one such list in the following lines. Print the number (k) of votes cast ((1 \le k \le 50\,000)). It can be shown that |
| 140239 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 308676296 | Marco_L_T | A | March 2, 2025, 3:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 61 | 102400 | ||
| 308651825 | panghupanghu wywcgs Zhuojie | A | March 2, 2025, 12:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 61 | 102400 | ||
| 308724969 | xie_T34 | A | March 3, 2025, 12:25 a.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308724936 | TadijaSebez | A | March 3, 2025, 12:25 a.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308722644 | Only_DP_Can_Save_ME | A | March 2, 2025, 11:49 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308705589 | El-Qadi | A | March 2, 2025, 8:01 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308698157 | Aryan_007 | A | March 2, 2025, 6:43 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308665811 | thangdz2k7 ShadowShark | A | March 2, 2025, 2:17 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308650834 | MH_Parag arman_ferdous ruhan.habib39 | A | March 2, 2025, 12:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308650430 | Mustang98 | A | March 2, 2025, 12:27 p.m. | OK | C++17 (GCC 7-32) | TESTS | 41 | 62 | 102400 | ||
| 308645159 | _helloLad Atekichan sv1shan | A | March 2, 2025, 11:48 a.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 46 | 102400 | ||
| 308735098 | stan23456 | A | March 3, 2025, 3:59 a.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 61 | 102400 | ||
| 308670896 | GOTKAKO | A | March 2, 2025, 2:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 61 | 102400 | ||
| 308641523 | turkhuu622 | A | March 2, 2025, 11:25 a.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 61 | 102400 | ||
| 308704708 | NuclearMint | A | March 2, 2025, 7:51 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 62 | 0 | ||
| 308693499 | jtnydv25 | A | March 2, 2025, 5:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 62 | 0 | ||
| 308691200 | aleksy | A | March 2, 2025, 5:38 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 62 | 0 | ||
| 308651070 | Pols_Agyi_Pols piyush_pransukhka kingmessi | A | March 2, 2025, 12:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 62 | 0 | ||
| 308635508 | molamola. gamegame | A | March 2, 2025, 10:45 a.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 62 | 0 | ||
| 308730894 | q1w2e3r4_1 | A | March 3, 2025, 2:40 a.m. | OK | C++20 (GCC 13-64) | TESTS | 41 | 62 | 102400 | ||
| 308658334 | merlin_wizard IMackerI Dakto | A | March 2, 2025, 1:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 61 | 102400 | ||
| 308731835 | Yorg41 | A | March 3, 2025, 3:02 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 0 | ||
| 308731771 | Yorg41 | A | March 3, 2025, 3 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 0 | ||
| 308731680 | Yorg41 | A | March 3, 2025, 2:58 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 0 | ||
| 308728992 | YungCf | A | March 3, 2025, 1:54 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 0 | ||
| 308728979 | Eous | A | March 3, 2025, 1:54 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 0 | ||
| 308728140 | ncstzsx | A | March 3, 2025, 1:33 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 102400 | ||
| 308725250 | _xguagua_Firefly_ | A | March 3, 2025, 12:31 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 102400 | ||
| 308692597 | Ibrahimfostok | A | March 2, 2025, 5:50 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 102400 | ||
| 308661389 | AA_Surely SarahLynn s.seraj.shafie | A | March 2, 2025, 1:46 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 41 | 62 | 102400 | ||
| 308642658 | arvindf232 Noam527 errorgorn | A | March 2, 2025, 11:32 a.m. | OK | Kotlin 1.9 | TESTS | 41 | 249 | 1945600 | ||
| 308697532 | AghaTizi klein199 Tlatoani | A | March 2, 2025, 6:37 p.m. | OK | Kotlin 1.9 | TESTS | 41 | 265 | 2764800 | ||
| 308664853 | mystichronicle | A | March 2, 2025, 2:10 p.m. | OK | Perl | TESTS | 41 | 171 | 8192000 | ||
| 308712088 | dhj | A | March 2, 2025, 8:58 p.m. | OK | PyPy 3-64 | TESTS | 41 | 155 | 9011200 | ||
| 308639425 | nikoro256 loop0919 harurun4635 | A | March 2, 2025, 11:11 a.m. | OK | PyPy 3-64 | TESTS | 41 | 171 | 4608000 | ||
| 308639319 | Maksim1744 | A | March 2, 2025, 11:11 a.m. | OK | Rust 2021 | TESTS | 41 | 77 | 102400 |
Back to search problems