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 |
---|---|---|---|---|---|---|
1695 | Codeforces Round 801 (Div. 2) and EPIC Institute of Technology Round | FINISHED | False | 7200 | 81617063 | June 18, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 454 ) | E | Ambiguous Dominoes | PROGRAMMING | constructive algorithms dfs and similar graphs |
B"Polycarp and Monocarp are both solving the same puzzle with dominoes. They are given the same set of n dominoes, the i -th of which contains two numbers x_i and y_i . They are also both given the same m by k grid of values a_{ij} such that m cdot k = 2n . The puzzle asks them to place the n dominoes on the grid in such a way that none of them overlap, and the values on each domino match the a_{ij} values that domino covers. Dominoes can be rotated arbitrarily before being placed on the grid, so the domino (x_i, y_i) is equivalent to the domino (y_i, x_i) . They have both solved the puzzle, and compared their answers, but noticed that not only did their solutions not match, but none of the n dominoes were in the same location in both solutions! Formally, if two squares were covered by the same domino in Polycarp's solution, they were covered by different dominoes in Monocarp's solution. The diagram below shows one potential a grid, along with the two players' solutions. Polycarp and Monocarp remember the set of dominoes they started with, but they have lost the grid a . Help them reconstruct one possible grid a , along with both of their solutions, or determine that no such grid exists. The first line contains a single integer n ( 1 <= n <= 3 cdot 10^5 ). The i -th of the next n lines contains two integers x_i and y_i ( 1 <= x_i, y_i <= 2n ). If there is no solution, print a single integer -1 . Otherwise, print m and k , the height and width of the puzzle grid, on the first line of output. These should satisfy m cdot k = 2n . The i -th of the next m lines should contain k integers, the j -th of which is a_{ij} . The next m lines describe Polycarp's solution. Print m lines of k characters each. For each square, if it is covered by the upper half of a domino in Poly"... |
Editorial for Codeforces Round #801 (Div. 2) and EPIC Institute of Technology Round |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
161119790 | rainboy | E | June 18, 2022, 5:32 p.m. | OK | GNU C11 | TESTS | 70 | 2714 | 34201600 | ||
161119223 | qinzhaoyang | E | June 18, 2022, 5:29 p.m. | OK | GNU C++14 | TESTS | 70 | 311 | 71782400 | ||
161147511 | peiwenjun | E | June 19, 2022, 4:03 a.m. | OK | GNU C++14 | TESTS | 70 | 327 | 25702400 | ||
161140989 | SuperJ6 | E | June 19, 2022, 12:42 a.m. | OK | GNU C++14 | TESTS | 70 | 405 | 50688000 | ||
161130554 | Bobocan | E | June 18, 2022, 7:26 p.m. | OK | GNU C++17 | TESTS | 70 | 374 | 21913600 | ||
161135250 | Bobocan | E | June 18, 2022, 9 p.m. | OK | GNU C++17 | TESTS | 70 | 389 | 26828800 | ||
161120376 | wiwitrifai | E | June 18, 2022, 5:35 p.m. | OK | GNU C++17 | TESTS | 70 | 436 | 39628800 | ||
161116873 | lucaperju | E | June 18, 2022, 4:34 p.m. | OK | GNU C++17 | TESTS | 70 | 452 | 41062400 | ||
161110777 | Agreb | E | June 18, 2022, 4:22 p.m. | OK | GNU C++17 | TESTS | 70 | 467 | 42496000 | ||
161134635 | magga | E | June 18, 2022, 8:47 p.m. | OK | GNU C++17 | TESTS | 70 | 467 | 56115200 | ||
161134003 | Kilani | E | June 18, 2022, 8:32 p.m. | OK | GNU C++17 | TESTS | 70 | 499 | 69836800 | ||
161123640 | user3348 | E | June 18, 2022, 6:01 p.m. | OK | GNU C++17 | TESTS | 70 | 499 | 78540800 | ||
161128507 | abc864197532 | E | June 18, 2022, 6:57 p.m. | OK | GNU C++17 | TESTS | 70 | 514 | 54476800 | ||
161140420 | limbo16 | E | June 19, 2022, 12:13 a.m. | OK | GNU C++17 | TESTS | 70 | 577 | 62361600 | ||
161140017 | neal | E | June 18, 2022, 11:54 p.m. | OK | GNU C++17 (64) | TESTS | 70 | 358 | 66662400 | ||
161139763 | neal | E | June 18, 2022, 11:41 p.m. | OK | GNU C++17 (64) | TESTS | 70 | 374 | 66662400 | ||
161138412 | kal013 | E | June 18, 2022, 10:45 p.m. | OK | GNU C++17 (64) | TESTS | 70 | 592 | 133836800 | ||
161141426 | xay5421 | E | June 19, 2022, 1:01 a.m. | OK | GNU C++17 (64) | TESTS | 70 | 748 | 109670400 | ||
161115236 | -is-this-fft- | E | June 18, 2022, 4:32 p.m. | OK | GNU C++20 (64) | TESTS | 70 | 389 | 74342400 | ||
161110097 | nuip | E | June 18, 2022, 4:20 p.m. | OK | GNU C++20 (64) | TESTS | 70 | 405 | 83251200 | ||
161127147 | emorgan5289 | E | June 18, 2022, 6:40 p.m. | OK | GNU C++20 (64) | TESTS | 70 | 420 | 93593600 | ||
161147459 | fengzhengwei | E | June 19, 2022, 4:01 a.m. | OK | GNU C++20 (64) | TESTS | 70 | 420 | 228761600 | ||
161147327 | Fysty | E | June 19, 2022, 3:58 a.m. | OK | GNU C++20 (64) | TESTS | 70 | 452 | 95027200 | ||
161139015 | Proofy | E | June 18, 2022, 11:10 p.m. | OK | GNU C++20 (64) | TESTS | 70 | 857 | 153804800 | ||
161122414 | lqs2015 | E | June 18, 2022, 5:50 p.m. | OK | GNU C++20 (64) | TESTS | 70 | 967 | 99635200 | ||
161143075 | dongliyushao | E | June 19, 2022, 2:02 a.m. | OK | GNU C++20 (64) | TESTS | 70 | 1029 | 58675200 | ||
161121849 | mtsd | E | June 18, 2022, 5:45 p.m. | OK | GNU C++20 (64) | TESTS | 70 | 1591 | 124620800 | ||
161145480 | ButterCake | E | June 19, 2022, 3:12 a.m. | OK | GNU C++20 (64) | TESTS | 70 | 2261 | 82022400 |
Back to search problems