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 |
---|---|---|---|---|---|---|
1790 | Codeforces Round 847 (Div. 3) | FINISHED | False | 8100 | 62436263 | Jan. 27, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 24580 ) | C | Premutation | PROGRAMMING | brute force implementation math |
B'A sequence of n numbers is called permutation if it contains all integers from 1 to n exactly once. For example, the sequences [ 3, 1, 4, 2 ], [ 1 ] and [ 2,1 ] are permutations, but [ 1,2,1 ], [ 0,1 ] and [ 1,3,4 ] -- are not. Kristina had a permutation p of n elements. She wrote it on the whiteboard n times in such a way that: For example, suppose Kristina had a permutation p = [4,2,1,3] of length 4 . Then she did the following: You know all n of sequences that have been written on the whiteboard, but you do not know the order in which they were written. They are given in arbitrary order. Reconstruct the original permutation from them. For example, if you know the sequences [4, 2, 1] , [4, 2, 3] , [2, 1, 3] , [4, 1, 3] , then the original permutation will be p = [4, 2, 1, 3] . The first line of input data contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains one integer n ( 3 <= n <= 100 ). This is followed by n lines, each containing exactly n-1 integers and describing one of the sequences written out on the whiteboard. It is guaranteed that all sequences could be obtained from some permutation p , and that the sum n^2 over all input sets does not exceed 2 cdot 10^5 . For each test case, output on a separate line a permutation p such that the given n sequences could be obtained from it. It is guaranteed that the answer exists and it is the only one. In other words, for each test case the required permutation is sure to exist. The first test case is described in the problem statement. In the second test case, the sequences are written in the correct order. '... |
111948 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
190877387 | plyasun | C | Jan. 27, 2023, 4:53 p.m. | OK | C# 10 | TESTS | 7 | 77 | 3788800 | ||
190874490 | AndreyNaumov | C | Jan. 27, 2023, 4:47 p.m. | OK | C# 10 | TESTS | 7 | 77 | 9420800 | ||
190878586 | anandkumarrana | C | Jan. 27, 2023, 4:58 p.m. | OK | Clang++17 Diagnostics | TESTS | 7 | 530 | 5222400 | ||
190918155 | xiaomadada | C | Jan. 28, 2023, 2:50 a.m. | OK | Clang++20 Diagnostics | TESTS | 7 | 576 | 0 | ||
190896949 | NenadDapic | C | Jan. 27, 2023, 7:24 p.m. | OK | FPC | TESTS | 7 | 77 | 0 | ||
190897702 | NenadDapic | C | Jan. 27, 2023, 7:33 p.m. | OK | FPC | TESTS | 7 | 93 | 0 | ||
190927976 | youthPaul | C | Jan. 28, 2023, 5:26 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 0 | ||
190913886 | goneww | C | Jan. 28, 2023, 1 a.m. | OK | GNU C++14 | TESTS | 7 | 31 | 0 | ||
190913187 | aCssen | C | Jan. 28, 2023, 12:40 a.m. | OK | GNU C++14 | TESTS | 7 | 31 | 0 | ||
190908375 | Mhamad_aboaljood | C | Jan. 27, 2023, 10:28 p.m. | OK | GNU C++14 | TESTS | 7 | 31 | 0 | ||
190874338 | nishkarsh | C | Jan. 27, 2023, 4:46 p.m. | OK | GNU C++14 | TESTS | 7 | 31 | 0 | ||
190925979 | fytftyf | C | Jan. 28, 2023, 5:04 a.m. | OK | GNU C++14 | TESTS | 7 | 31 | 102400 | ||
190922874 | six_one | C | Jan. 28, 2023, 4:23 a.m. | OK | GNU C++14 | TESTS | 7 | 31 | 102400 | ||
190915215 | lqj | C | Jan. 28, 2023, 1:36 a.m. | OK | GNU C++14 | TESTS | 7 | 31 | 102400 | ||
190907028 | AbrarTo_o | C | Jan. 27, 2023, 9:57 p.m. | OK | GNU C++14 | TESTS | 7 | 31 | 102400 | ||
190893115 | davis_kb | C | Jan. 27, 2023, 6:44 p.m. | OK | GNU C++14 | TESTS | 7 | 31 | 102400 |
Back to search problems