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 |
---|---|---|---|---|---|---|
1815 | Codeforces Round 865 (Div. 1) | FINISHED | False | 8100 | 50771699 | April 9, 2023, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2000 ) | C | Between | PROGRAMMING | constructive algorithms dfs and similar graphs greedy shortest paths | 2200 |
B'You are given an integer n , as well as m pairs of integers (a_i,b_i) , where 1 <= q a_i , b_i <= q n , a_i ne b_i . You want to construct a sequence satisfying the following requirements: Sometimes, it is possible that such a sequence can be arbitrarily long, in which case you should output "INFINITE". Otherwise, you should output "FINITE" and the sequence itself. If there are multiple possible constructions that yield the maximum length, output any. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 300 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n and m ( 1 <= n <= 1500 , 0 <= m <= 5000 ) -- the maximum possible value of the element of the sequence and the number of pairs. The i -th of the next m lines contain two integers a_i and b_i ( 1 <= a_i , b_i <= n , a_i ne b_i ). (a_i, b_i) ne (a_j, b_j) for all 1 <= i < j <= m . It is guaranteed that sum of n over all test cases doesn 't exceed 1500 and the sum of m over all test cases doesn 't exceed 5000 . For each test case, on the first line output "INFINITE" if the sequence can be arbitrarily long, and "FINITE" otherwise. If you have outputted "FINITE", then your output should be followed by 2 lines. The first line contains an integer s , the maximum length of the sequence. The second line contains s integers, each are between 1 and n inclusive, representing the elements of the sequence. If there are multiple sequences with the maximum length, output any of them. It can be shown that, for all test cases with answer "FINITE", then under the constraints, the maximum possible sum of sequence lengths of those test cases does not exceed 2 cdot10^6 . In the first test case, there is an element 1 between two elemen'... |
Editorial of Codeforces Round #865 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
201563099 | LeonidR | C | April 9, 2023, 4:59 p.m. | OK | C# 10 | TESTS | 121 | 577 | 85811200 | 2200 | |
201504101 | hos.lyric | C | April 9, 2023, 3:12 p.m. | OK | D | TESTS | 121 | 732 | 6144000 | 2200 | |
201551005 | chro4896 | C | April 9, 2023, 4:30 p.m. | OK | GNU C11 | TESTS | 121 | 249 | 28057600 | 2200 | |
201534071 | busamate | C | April 9, 2023, 3:53 p.m. | OK | GNU C++14 | TESTS | 121 | 108 | 409600 | 2200 | |
201556785 | XG0000 | C | April 9, 2023, 4:44 p.m. | OK | GNU C++14 | TESTS | 121 | 124 | 307200 | 2200 | |
201551577 | stOzenghaoweiOrz | C | April 9, 2023, 4:32 p.m. | OK | GNU C++14 | TESTS | 121 | 124 | 307200 | 2200 | |
201616919 | LinkZelda1225 | C | April 10, 2023, 5:32 a.m. | OK | GNU C++14 | TESTS | 121 | 124 | 307200 | 2200 | |
201615493 | -LAP- | C | April 10, 2023, 5:12 a.m. | OK | GNU C++14 | TESTS | 121 | 124 | 4812800 | 2200 | |
201561421 | jiaosiyuan | C | April 9, 2023, 4:56 p.m. | OK | GNU C++14 | TESTS | 121 | 124 | 14028800 | 2200 | |
201551025 | Uagu | C | April 9, 2023, 4:30 p.m. | OK | GNU C++14 | TESTS | 121 | 139 | 204800 | 2200 | |
201533783 | Imdie | C | April 9, 2023, 3:52 p.m. | OK | GNU C++14 | TESTS | 121 | 139 | 307200 | 2200 | |
201555362 | prokulijander | C | April 9, 2023, 4:41 p.m. | OK | GNU C++14 | TESTS | 121 | 139 | 307200 | 2200 | |
201520003 | MakaPakka | C | April 9, 2023, 3:31 p.m. | OK | GNU C++14 | TESTS | 121 | 139 | 512000 | 2200 | |
201532018 | null_awe | C | April 9, 2023, 3:49 p.m. | OK | GNU C++17 | TESTS | 121 | 108 | 307200 | 2200 | |
201560984 | abcpony | C | April 9, 2023, 4:55 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 307200 | 2200 | |
201532374 | PlasmaVortex | C | April 9, 2023, 3:50 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 307200 | 2200 | |
201515636 | feeder1 | C | April 9, 2023, 3:25 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 307200 | 2200 | |
201562735 | huxiaotaostasy | C | April 9, 2023, 4:58 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 307200 | 2200 | |
201566236 | Sedmoklasnikut | C | April 9, 2023, 5:39 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 614400 | 2200 | |
201566483 | FzArK | C | April 9, 2023, 5:40 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 4198400 | 2200 | |
201517219 | teraqqq | C | April 9, 2023, 3:27 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 12800000 | 2200 | |
201537117 | erekle | C | April 9, 2023, 3:59 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 12800000 | 2200 | |
201523713 | EnAnimant | C | April 9, 2023, 3:36 p.m. | OK | GNU C++17 | TESTS | 121 | 124 | 12902400 | 2200 | |
201535492 | Bungmint | C | April 9, 2023, 3:55 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 92 | 13824000 | 2200 | |
201527801 | ALILILILILI-KHAN | C | April 9, 2023, 3:42 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 92 | 18432000 | 2200 | |
201557345 | KKT_89 | C | April 9, 2023, 4:46 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 93 | 13824000 | 2200 | |
201561635 | Giga_Cronos | C | April 9, 2023, 4:56 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 93 | 26419200 | 2200 | |
201603352 | yzc2005 | C | April 10, 2023, 1:47 a.m. | OK | GNU C++17 (64) | TESTS | 121 | 108 | 102400 | 2200 | |
201581802 | PurpleCrayon | C | April 9, 2023, 7:51 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 108 | 2969600 | 2200 | |
201525047 | kotatsugame | C | April 9, 2023, 3:38 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 108 | 8192000 | 2200 | |
201531795 | clam | C | April 9, 2023, 3:49 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 108 | 13926400 | 2200 | |
201549968 | GSYL | C | April 9, 2023, 4:27 p.m. | OK | GNU C++17 (64) | TESTS | 121 | 108 | 14233600 | 2200 | |
201606475 | gqf123 | C | April 10, 2023, 2:49 a.m. | OK | GNU C++17 (64) | TESTS | 121 | 108 | 21196800 | 2200 | |
201559469 | Tomx | C | April 9, 2023, 4:51 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 46 | 12492800 | 2200 | |
201551532 | MAKMED1337 | C | April 9, 2023, 4:31 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 46 | 13824000 | 2200 | |
201549939 | laurxh | C | April 9, 2023, 4:27 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 46 | 13926400 | 2200 | |
201510486 | maspy | C | April 9, 2023, 3:19 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 46 | 14131200 | 2200 | |
201523878 | PyIsBestLang | C | April 9, 2023, 3:36 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 61 | 102400 | 2200 | |
201528734 | fastmath | C | April 9, 2023, 3:44 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 61 | 204800 | 2200 | |
201542058 | Turkhuuu | C | April 9, 2023, 4:09 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 61 | 13824000 | 2200 | |
201614873 | KevinWan | C | April 10, 2023, 5:04 a.m. | OK | GNU C++20 (64) | TESTS | 121 | 61 | 15974400 | 2200 | |
201534730 | Be_dos | C | April 9, 2023, 3:54 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 62 | 102400 | 2200 | |
201531211 | Misono_Mika | C | April 9, 2023, 3:48 p.m. | OK | GNU C++20 (64) | TESTS | 121 | 62 | 13824000 | 2200 | |
201616078 | profchi | C | April 10, 2023, 5:20 a.m. | OK | Java 11 | TESTS | 121 | 498 | 14131200 | 2200 | |
201610655 | UlaanBatat | C | April 10, 2023, 4 a.m. | OK | Java 17 | TESTS | 121 | 280 | 28774400 | 2200 | |
201602704 | UlaanBatat | C | April 10, 2023, 1:32 a.m. | OK | Java 17 | TESTS | 121 | 295 | 20787200 | 2200 | |
201558945 | goIions | C | April 9, 2023, 4:50 p.m. | OK | Java 8 | TESTS | 121 | 280 | 62464000 | 2200 | |
201591435 | golions | C | April 9, 2023, 9:46 p.m. | OK | Java 8 | TESTS | 121 | 592 | 56320000 | 2200 | |
201541555 | fetetriste | C | April 9, 2023, 4:08 p.m. | OK | Java 8 | TESTS | 121 | 1653 | 224153600 | 2200 | |
201504317 | Tlatoani | C | April 9, 2023, 3:12 p.m. | OK | Kotlin 1.7 | TESTS | 121 | 529 | 73420800 | 2200 | |
201572241 | SPD_9X2 | C | April 9, 2023, 6:17 p.m. | OK | PyPy 3 | TESTS | 121 | 764 | 103833600 | 2200 | |
201560521 | plevande | C | April 9, 2023, 4:54 p.m. | OK | PyPy 3 | TESTS | 121 | 873 | 101068800 | 2200 | |
201588818 | huikang | C | April 9, 2023, 9:09 p.m. | OK | PyPy 3-64 | TESTS | 121 | 248 | 38809600 | 2200 | |
201548029 | huangxw | C | April 9, 2023, 4:22 p.m. | OK | PyPy 3-64 | TESTS | 121 | 327 | 93081600 | 2200 | |
201523924 | dyppp | C | April 9, 2023, 3:36 p.m. | OK | PyPy 3-64 | TESTS | 121 | 358 | 80588800 | 2200 | |
201514856 | Maruzensky | C | April 9, 2023, 3:24 p.m. | OK | PyPy 3-64 | TESTS | 121 | 358 | 83148800 | 2200 | |
201606470 | Little_Sheep_Yawn | C | April 10, 2023, 2:48 a.m. | OK | PyPy 3-64 | TESTS | 121 | 358 | 89600000 | 2200 | |
201551779 | yooyou7 | C | April 9, 2023, 4:32 p.m. | OK | PyPy 3-64 | TESTS | 121 | 389 | 90726400 | 2200 | |
201542783 | toam | C | April 9, 2023, 4:10 p.m. | OK | PyPy 3-64 | TESTS | 121 | 421 | 85811200 | 2200 | |
201549606 | bronze_coder | C | April 9, 2023, 4:26 p.m. | OK | PyPy 3-64 | TESTS | 121 | 1388 | 177152000 | 2200 | |
201518401 | sansen | C | April 9, 2023, 3:29 p.m. | OK | Rust 2021 | TESTS | 121 | 93 | 32563200 | 2200 | |
201549766 | Unwise | C | April 9, 2023, 4:27 p.m. | OK | Rust 2021 | TESTS | 121 | 140 | 27136000 | 2200 |
Back to search problems