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 |
---|---|---|---|---|---|---|
1991 | Pinely Round 4 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 15002663 | July 28, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4356 ) | E | Coloring Game | PROGRAMMING | constructive algorithms games graphs greedy interactive |
B'This is an interactive problem. Consider an undirected connected graph consisting of n vertices and m edges. Each vertex can be colored with one of three colors: 1 , 2 , or 3 . Initially, all vertices are uncolored. Alice and Bob are playing a game consisting of n rounds. In each round, the following two-step process happens: Alice wins if there exists an edge connecting two vertices of the same color. Otherwise, Bob wins. You are given the graph. Your task is to decide which player you wish to play as and win the game. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n , m ( 1 <= n <= 10^4 , n - 1 <= m <= min( frac{n cdot (n - 1)}{2}, 10^4) ) -- the number of vertices and the number of edges in the graph, respectively. Each of the next m lines of each test case contains two integers u_i , v_i ( 1 <= u_i, v_i <= n ) -- the edges of the graph. It is guaranteed that the graph is connected and there are no multiple edges or self-loops. It is guaranteed that the sum of n and the sum of m over all test cases does not exceed 10^4 . For each test case, you need to output a single line containing either "Alice" or "Bob", representing the player you choose. Then for each of the following n rounds, the following two-step process happens: If any of your outputs are invalid, the jury will output "-1" and you will receive a Wrong Answer verdict. At the end of all n turns, if you have lost the game, the jury will output "-1" and you will receive a Wrong Answer verdict. If your program has received a -1 instead of a valid value, it must terminate immediately. Otherwise, you may receive an arbitrary verdict because your solution might be reading from a closed strea'... |
Video Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
273220761 | stupidnessplusplus | E | July 28, 2024, 5:15 p.m. | OK | C# 10 | TESTS | 30 | 265 | 9216000 | ||
273282615 | xinyu123_AKIOI | E | July 29, 2024, 5:53 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 140 | 204800 | ||
273281176 | root357 | E | July 29, 2024, 5:38 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 140 | 204800 | ||
273280981 | root357 | E | July 29, 2024, 5:36 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 140 | 204800 | ||
273238699 | cbdsopa | E | July 28, 2024, 7:24 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 140 | 204800 | ||
273225902 | Zxd2009 | E | July 28, 2024, 5:28 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 140 | 307200 | ||
273225957 | Anonymous31416 | E | July 28, 2024, 5:28 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 140 | 34201600 | ||
273260547 | piggium__ | E | July 29, 2024, 1:37 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 155 | 307200 | ||
273222918 | Lzy_ | E | July 28, 2024, 5:21 p.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 155 | 307200 | ||
273270938 | operator_ | E | July 29, 2024, 3:39 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 155 | 512000 | ||
273258136 | xieliren2021 | E | July 29, 2024, 1:04 a.m. | OK | C++14 (GCC 6-32) | TESTS | 30 | 155 | 1638400 | ||
273255934 | SeaUrc | E | July 29, 2024, 12:22 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 124 | 0 | ||
273223722 | shivamp_07 | E | July 28, 2024, 5:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 139 | 0 | ||
273282400 | JML | E | July 29, 2024, 5:50 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273273908 | iamloser1100 | E | July 29, 2024, 4:14 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273256820 | hvbird | E | July 29, 2024, 12:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273252828 | himanshuhy004 | E | July 28, 2024, 11:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273252706 | rfcc | E | July 28, 2024, 11:05 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273240922 | LittleMoon | E | July 28, 2024, 7:48 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273237938 | BihariRaand | E | July 28, 2024, 7:17 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273236971 | KKorz | E | July 28, 2024, 7:09 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 140 | 0 | ||
273260688 | Aicu | E | July 29, 2024, 1:38 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 108 | 0 | ||
273224262 | MKasirloo | E | July 28, 2024, 5:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 0 | ||
273267349 | MarSer020 | E | July 29, 2024, 2:58 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 307200 | ||
273263178 | anhkha1004 | E | July 29, 2024, 2:10 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 307200 | ||
273248119 | Abdalaziz_Alshami | E | July 28, 2024, 9:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 307200 | ||
273273805 | Flaming_Blade | E | July 29, 2024, 4:13 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 124 | 409600 | ||
273263549 | khangai11 | E | July 29, 2024, 2:14 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 0 | ||
273260953 | aklk1ng | E | July 29, 2024, 1:42 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 0 | ||
273256671 | linearspace | E | July 29, 2024, 12:37 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 0 | ||
273270343 | umbrella-leaf | E | July 29, 2024, 3:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 139 | 307200 | ||
273220211 | lnsuyn | E | July 28, 2024, 5:14 p.m. | OK | GNU C11 | TESTS | 30 | 233 | 8806400 | ||
273282172 | ArminArlert69 | E | July 29, 2024, 5:48 a.m. | OK | GNU C11 | TESTS | 30 | 249 | 8396800 | ||
273227903 | WORTH | E | July 28, 2024, 5:33 p.m. | OK | Java 21 | TESTS | 30 | 483 | 1638400 | ||
273223060 | UlaanBatat | E | July 28, 2024, 5:21 p.m. | OK | Java 21 | TESTS | 30 | 546 | 2048000 | ||
273249232 | man-ray | E | July 28, 2024, 9:54 p.m. | OK | Java 21 | TESTS | 30 | 562 | 1228800 | ||
273254275 | dzhi | E | July 28, 2024, 11:42 p.m. | OK | Java 21 | TESTS | 30 | 593 | 2252800 | ||
273226069 | KKorz | E | July 28, 2024, 5:29 p.m. | OK | Java 21 | TESTS | 30 | 734 | 1126400 | ||
273273795 | zee_money | E | July 29, 2024, 4:13 a.m. | OK | Java 21 | TESTS | 30 | 750 | 3072000 | ||
273274781 | zee_money | E | July 29, 2024, 4:25 a.m. | OK | Java 21 | TESTS | 30 | 999 | 2048000 | ||
273238232 | kartik__sethi | E | July 28, 2024, 7:19 p.m. | OK | Java 8 | TESTS | 30 | 453 | 0 | ||
273236215 | redreoicy | E | July 28, 2024, 7:04 p.m. | OK | Java 8 | TESTS | 30 | 531 | 716800 | ||
273253187 | arvindf232 | E | July 28, 2024, 11:16 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 281 | 204800 | ||
273253056 | bruhopen | E | July 28, 2024, 11:13 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 281 | 204800 | ||
273252883 | bruhopen | E | July 28, 2024, 11:09 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 281 | 204800 | ||
273252704 | bruhopen | E | July 28, 2024, 11:05 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 296 | 409600 | ||
273253391 | arvindf232 | E | July 28, 2024, 11:21 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 312 | 102400 | ||
273252983 | bruhopen | E | July 28, 2024, 11:11 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 327 | 204800 | ||
273252784 | bruhopen | E | July 28, 2024, 11:07 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 327 | 204800 | ||
273252856 | bruhopen | E | July 28, 2024, 11:08 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 343 | 204800 | ||
273252748 | bruhopen | E | July 28, 2024, 11:06 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 343 | 409600 | ||
273252656 | bruhopen | E | July 28, 2024, 11:04 p.m. | OK | Kotlin 1.9 | TESTS | 30 | 358 | 307200 | ||
273267303 | bpdolson | E | July 29, 2024, 2:57 a.m. | OK | PyPy 3 | TESTS | 30 | 874 | 10547200 | ||
273220672 | vlk0 | E | July 28, 2024, 5:15 p.m. | OK | PyPy 3 | TESTS | 30 | 921 | 10752000 | ||
273240217 | the_last_smilodon | E | July 28, 2024, 7:40 p.m. | OK | PyPy 3-64 | TESTS | 30 | 437 | 9113600 | ||
273236321 | Joris_Perrenet | E | July 28, 2024, 7:04 p.m. | OK | PyPy 3-64 | TESTS | 30 | 453 | 8908800 | ||
273221911 | Codetic | E | July 28, 2024, 5:18 p.m. | OK | PyPy 3-64 | TESTS | 30 | 484 | 7577600 | ||
273219873 | kagu | E | July 28, 2024, 5:13 p.m. | OK | PyPy 3-64 | TESTS | 30 | 484 | 8396800 | ||
273219621 | LMeyling | E | July 28, 2024, 5:12 p.m. | OK | PyPy 3-64 | TESTS | 30 | 515 | 8908800 | ||
273221045 | wish-nu | E | July 28, 2024, 5:16 p.m. | OK | PyPy 3-64 | TESTS | 30 | 515 | 9113600 | ||
273265153 | young_skywalker_ | E | July 29, 2024, 2:32 a.m. | OK | PyPy 3-64 | TESTS | 30 | 530 | 9216000 | ||
273268583 | VitaLemonTea | E | July 29, 2024, 3:11 a.m. | OK | PyPy 3-64 | TESTS | 30 | 546 | 110182400 | ||
273277035 | satyamshrma | E | July 29, 2024, 4:51 a.m. | OK | PyPy 3-64 | TESTS | 30 | 562 | 9011200 | ||
273221511 | becool0702 | E | July 28, 2024, 5:17 p.m. | OK | PyPy 3-64 | TESTS | 30 | 562 | 9113600 | ||
273275072 | Akshar_7 | E | July 29, 2024, 4:28 a.m. | OK | Python 3 | TESTS | 30 | 281 | 1638400 | ||
273220776 | 123gjweq2 | E | July 28, 2024, 5:15 p.m. | OK | Python 3 | TESTS | 30 | 328 | 3174400 | ||
273221560 | Gaurav1 | E | July 28, 2024, 5:17 p.m. | OK | Python 3 | TESTS | 30 | 343 | 3174400 | ||
273222987 | liut | E | July 28, 2024, 5:21 p.m. | OK | Rust 2021 | TESTS | 30 | 203 | 0 | ||
273254470 | fieubat2x | E | July 28, 2024, 11:47 p.m. | OK | Rust 2021 | TESTS | 30 | 218 | 0 |
Back to search problems