Good Bye 2021: 2022 is NEAR

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
1616 Good Bye 2021: 2022 is NEAR FINISHED False 7200 96474263 Dec. 29, 2021, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 608 ) F Tricolor Triangles PROGRAMMING graphs math matrices 2900

B'You are given a simple undirected graph with n vertices and m edges. Edge i is colored in the color c_i , which is either 1 , 2 , or 3 , or left uncolored (in this case, c_i = -1 ). You need to color all of the uncolored edges in such a way that for any three pairwise adjacent vertices 1 <= q a < b < c <= q n , the colors of the edges a <= ftrightarrow b , b <= ftrightarrow c , and a <= ftrightarrow c are either pairwise different, or all equal. In case no such coloring exists, you need to determine that. The first line of input contains one integer t ( 1 <= q t <= q 10 ): the number of test cases. The following lines contain the description of the test cases. In the first line you are given two integers n and m ( 3 <= q n <= q 64 , 0 <= q m <= q min(256, frac{n(n-1)}{2}) ): the number of vertices and edges in the graph. Each of the next m lines contains three integers a_i , b_i , and c_i ( 1 <= q a_i, b_i <= q n , a_i ne b_i , c_i is either -1 , 1 , 2 , or 3 ), denoting an edge between a_i and b_i with color c_i . It is guaranteed that no two edges share the same endpoints. For each test case, print m integers d_1, d_2, ldots, d_m , where d_i is the color of the i -th edge in your final coloring. If there is no valid way to finish the coloring, print -1 . '...

Tutorials

Good Bye 2021 -- Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
141133267 happyguy656 F Dec. 29, 2021, 6:33 p.m. OK Clang++17 Diagnostics TESTS 37 592 214528000 2900
141134583 rainboy F Dec. 29, 2021, 6:47 p.m. OK GNU C11 TESTS 38 686 307200 2900
141130129 zeliboba F Dec. 29, 2021, 6:09 p.m. OK GNU C++14 TESTS 36 31 2048000 2900
141133329 happyguy656 F Dec. 29, 2021, 6:34 p.m. OK GNU C++14 TESTS 37 31 208998400 2900
141177970 eecs F Dec. 30, 2021, 3:53 p.m. OK GNU C++14 TESTS 43 171 307200 2900
141157490 ishsonya F Dec. 30, 2021, 12:08 p.m. OK GNU C++14 TESTS 42 202 2764800 2900
141207887 Melania F Dec. 31, 2021, 2:45 a.m. OK GNU C++14 TESTS 43 217 0 2900
141206140 realFZzzz F Dec. 31, 2021, 1:42 a.m. OK GNU C++14 TESTS 43 249 2764800 2900
141179046 Yukino05 F Dec. 30, 2021, 4:06 p.m. OK GNU C++14 TESTS 43 358 25190400 2900
141161942 hydd F Dec. 30, 2021, 12:56 p.m. OK GNU C++14 TESTS 42 483 102400 2900
141178017 eecs F Dec. 30, 2021, 3:53 p.m. OK GNU C++14 TESTS 43 592 307200 2900
141177712 eecs F Dec. 30, 2021, 3:49 p.m. OK GNU C++14 TESTS 43 624 307200 2900
141130873 dlhham F Dec. 29, 2021, 6:14 p.m. OK GNU C++17 TESTS 37 31 204800 2900
141208129 user202729_ F Dec. 31, 2021, 2:54 a.m. OK GNU C++17 TESTS 43 31 512000 2900
141188541 fxhd F Dec. 30, 2021, 6:01 p.m. OK GNU C++17 TESTS 43 31 512000 2900
141208405 user202729_ F Dec. 31, 2021, 3:05 a.m. OK GNU C++17 TESTS 43 46 1228800 2900
141130832 Marckess F Dec. 29, 2021, 6:14 p.m. OK GNU C++17 TESTS 37 46 2252800 2900
141208395 emofunc F Dec. 31, 2021, 3:04 a.m. OK GNU C++17 TESTS 43 62 409600 2900
141154689 Juanzhang F Dec. 30, 2021, 11:38 a.m. OK GNU C++17 TESTS 42 93 409600 2900
141180195 fallleaves01 F Dec. 30, 2021, 4:20 p.m. OK GNU C++17 TESTS 43 93 2048000 2900
141194829 destructor_19 F Dec. 30, 2021, 7:32 p.m. OK GNU C++17 TESTS 43 93 6860800 2900
141193905 Atreus F Dec. 30, 2021, 7:15 p.m. OK GNU C++17 TESTS 43 93 10444800 2900
141131951 PinkieRabbit F Dec. 29, 2021, 6:22 p.m. OK GNU C++17 (64) TESTS 37 15 2150400 2900
141132094 dengyaotriangle F Dec. 29, 2021, 6:23 p.m. OK GNU C++17 (64) TESTS 37 31 307200 2900
141130743 zdolna_kaczka F Dec. 29, 2021, 6:13 p.m. OK GNU C++17 (64) TESTS 36 31 307200 2900
141157387 He_Ren F Dec. 30, 2021, 12:07 p.m. OK GNU C++17 (64) TESTS 42 31 409600 2900
141130471 PinkieRabbit F Dec. 29, 2021, 6:11 p.m. OK GNU C++17 (64) TESTS 36 31 2150400 2900
141156933 He_Ren F Dec. 30, 2021, 12:02 p.m. OK GNU C++17 (64) TESTS 42 46 409600 2900
141196827 modulus F Dec. 30, 2021, 8:09 p.m. OK GNU C++17 (64) TESTS 43 46 512000 2900
141195752 modulus F Dec. 30, 2021, 7:49 p.m. OK GNU C++17 (64) TESTS 43 46 512000 2900
141195086 modulus F Dec. 30, 2021, 7:37 p.m. OK GNU C++17 (64) TESTS 43 46 512000 2900
141136607 HJKL1018 F Dec. 30, 2021, 8:26 a.m. OK GNU C++17 (64) TESTS 39 46 6451200 2900
141150827 maxplus F Dec. 30, 2021, 11:01 a.m. OK GNU C++20 (64) TESTS 42 15 2150400 2900
141130762 kefaa2 F Dec. 29, 2021, 6:13 p.m. OK GNU C++20 (64) TESTS 36 31 819200 2900
141152546 maxplus F Dec. 30, 2021, 11:17 a.m. OK GNU C++20 (64) TESTS 42 31 1638400 2900
141151892 maxplus F Dec. 30, 2021, 11:12 a.m. OK GNU C++20 (64) TESTS 42 31 1638400 2900
141151137 maxplus F Dec. 30, 2021, 11:04 a.m. OK GNU C++20 (64) TESTS 42 31 2150400 2900
141151069 maxplus F Dec. 30, 2021, 11:04 a.m. OK GNU C++20 (64) TESTS 42 31 2150400 2900
141151025 maxplus F Dec. 30, 2021, 11:03 a.m. OK GNU C++20 (64) TESTS 42 31 2150400 2900
141150984 maxplus F Dec. 30, 2021, 11:03 a.m. OK GNU C++20 (64) TESTS 42 31 2150400 2900
141150952 maxplus F Dec. 30, 2021, 11:02 a.m. OK GNU C++20 (64) TESTS 42 31 2150400 2900
141138104 HideOneMan2002 F Dec. 30, 2021, 8:54 a.m. OK GNU C++20 (64) TESTS 39 46 307200 2900
141196812 knightL F Dec. 30, 2021, 8:09 p.m. OK Java 11 TESTS 43 826 307200 2900
141204603 whatshisbucket F Dec. 31, 2021, 12:38 a.m. OK PyPy 3 TESTS 43 389 11366400 2900

remove filters

Back to search problems