Codeforces Global Round 28

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
2048 Codeforces Global Round 28 FINISHED False 10800 41786723 Dec. 19, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3478 ) E Kevin and Bipartite Graph PROGRAMMING constructive algorithms graphs greedy

The Arms Factory needs a poster design pattern and finds Kevin for help. A poster design pattern is a bipartite graph with (2n) vertices in the left part and (m) vertices in the right part, where there is an edge between each vertex in the left part and each vertex in the right part, resulting in a total of (2nm) edges. Kevin must color each edge with a positive integer in the range (1, n). A poster design pattern is good if there are no monochromatic cycles(^{\text{∗}}) in the bipartite graph. Kevin needs your assistance in constructing a good bipartite graph or informing him if it is impossible. (^{\text{∗}})A monochromatic cycle refers to a simple cycle in which all the edges are colored with the same color. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The only line of each test case contains two integers (n) and (m) ((1 \le n, m \leq 10^3)) — the bipartite graph has (2n) vertices in the left part and (m) vertices in the right part. It is guaranteed that both the sum of (n) and the sum of (m) over all test cases do not exceed (10^3). For each test case, if there is no solution, then output No . Otherwise, output Yes , and then output (2n) lines, with each line containing (m) positive integers. The (i)-th line's (j)-th integer represents the color of the edge between the (i)-th vertex in the left part and the (j)-th vertex in the right part. If there are multiple answers, you can print any of them. You can output each letter in any case (for example, the strings yEs , yes , Yes , and YES will be recognized as a positive answer). For the first test case, the graph is shown as follows: For the second test case, it can be proven that there is no valid solution.

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
297389378 og.kostya E Dec. 20, 2024, 5:45 a.m. OK C# 10 TESTS 17 124 3072000
297377091 LXH-cat E Dec. 20, 2024, 2:45 a.m. OK C++17 (GCC 7-32) TESTS 17 187 0
297372858 OrangeLine159 E Dec. 20, 2024, 1:02 a.m. OK C++17 (GCC 7-32) TESTS 17 187 102400
297390407 cow23 E Dec. 20, 2024, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 17 202 0
297386414 Spad2e E Dec. 20, 2024, 5:13 a.m. OK C++17 (GCC 7-32) TESTS 17 202 0
297378245 Gotsuhan E Dec. 20, 2024, 3:07 a.m. OK C++17 (GCC 7-32) TESTS 17 202 0
297367686 maherayari24 E Dec. 19, 2024, 10:16 p.m. OK C++17 (GCC 7-32) TESTS 17 202 0
297363749 Vansh_Sohal E Dec. 19, 2024, 8:56 p.m. OK C++17 (GCC 7-32) TESTS 17 202 0
297381797 HoangMC2009 E Dec. 20, 2024, 4:08 a.m. OK C++17 (GCC 7-32) TESTS 17 202 102400
297380466 Rua_vip E Dec. 20, 2024, 3:46 a.m. OK C++17 (GCC 7-32) TESTS 17 202 3686400
297369889 vanvector E Dec. 19, 2024, 11:24 p.m. OK C++17 (GCC 7-32) TESTS 17 202 4915200
297380391 ardeelia E Dec. 20, 2024, 3:44 a.m. OK C++20 (GCC 13-64) TESTS 17 93 10035200
297345425 kaichou243 E Dec. 19, 2024, 5:33 p.m. OK C++20 (GCC 13-64) TESTS 17 108 614400
297368780 domovonok E Dec. 19, 2024, 10:48 p.m. OK C++20 (GCC 13-64) TESTS 17 109 102400
297369395 alexalvarez123 E Dec. 19, 2024, 11:08 p.m. OK C++20 (GCC 13-64) TESTS 17 124 0
297388107 Running_a_way E Dec. 20, 2024, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 17 124 102400
297377379 xingye2 E Dec. 20, 2024, 2:50 a.m. OK C++20 (GCC 13-64) TESTS 17 124 102400
297376628 lrXac E Dec. 20, 2024, 2:35 a.m. OK C++20 (GCC 13-64) TESTS 17 124 102400
297370571 I_FloPPed21 E Dec. 19, 2024, 11:48 p.m. OK C++20 (GCC 13-64) TESTS 17 124 102400
297354308 kingbass E Dec. 19, 2024, 7:02 p.m. OK C++20 (GCC 13-64) TESTS 17 124 5120000
297352383 iamaryankr E Dec. 19, 2024, 6:48 p.m. OK C++20 (GCC 13-64) TESTS 17 124 5120000
297376046 FifthAxiom E Dec. 20, 2024, 2:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 124 0
297381500 Yuanrb E Dec. 20, 2024, 4:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 139 102400
297368796 mihamag E Dec. 19, 2024, 10:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 0
297351014 Splashing E Dec. 19, 2024, 6:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 0
297337013 prairie2022 E Dec. 19, 2024, 5:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 0
297385167 XYukari E Dec. 20, 2024, 4:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 102400
297379219 adiyer E Dec. 20, 2024, 3:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 102400
297377477 Rating_10101010 E Dec. 20, 2024, 2:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 102400
297353039 SSerxhs E Dec. 19, 2024, 6:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 102400
297344603 convective_rain E Dec. 19, 2024, 5:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 17 140 102400
297338665 Gassa E Dec. 19, 2024, 5:12 p.m. OK D TESTS 17 764 6553600
297370303 lyongwolf E Dec. 19, 2024, 11:39 p.m. OK Java 21 TESTS 17 280 512000
297350629 Dukkha E Dec. 19, 2024, 6:36 p.m. OK Java 21 TESTS 17 593 1331200
297339499 Quasicoherent E Dec. 19, 2024, 5:15 p.m. OK Java 21 TESTS 17 624 19046400
297336830 etian6795 E Dec. 19, 2024, 5:06 p.m. OK Java 8 TESTS 17 374 5427200
297353502 vainilla E Dec. 19, 2024, 6:55 p.m. OK PyPy 3 TESTS 17 749 9523200
297340638 conqueror_of_tourist E Dec. 19, 2024, 5:19 p.m. OK PyPy 3-64 TESTS 17 155 34918400
297342683 boolatreides E Dec. 19, 2024, 5:25 p.m. OK PyPy 3-64 TESTS 17 155 42905600
297355394 akhanchick E Dec. 19, 2024, 7:13 p.m. OK PyPy 3-64 TESTS 17 171 34304000
297380594 ardeelia E Dec. 20, 2024, 3:48 a.m. OK PyPy 3-64 TESTS 17 171 36044800
297368785 I-Nobody E Dec. 19, 2024, 10:48 p.m. OK PyPy 3-64 TESTS 17 217 34611200
297341475 CursedCraftsman E Dec. 19, 2024, 5:22 p.m. OK PyPy 3-64 TESTS 17 249 8704000
297342197 Phuocbua E Dec. 19, 2024, 5:24 p.m. OK PyPy 3-64 TESTS 17 265 9113600
297343474 Klass_Mars E Dec. 19, 2024, 5:28 p.m. OK PyPy 3-64 TESTS 17 280 9113600
297367549 DeadMan69 E Dec. 19, 2024, 10:12 p.m. OK PyPy 3-64 TESTS 17 296 9830400
297343056 Heartbeateffect E Dec. 19, 2024, 5:27 p.m. OK PyPy 3-64 TESTS 17 296 22937600
297359185 DeathbringerY E Dec. 19, 2024, 7:54 p.m. OK Python 3 TESTS 17 1593 17100800

remove filters

Back to search problems