Codeforces Round 693 (Div. 3)

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
1472 Codeforces Round 693 (Div. 3) FINISHED False 7200 122052299 Jan. 4, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3077 ) F New Year's Puzzle PROGRAMMING brute force dp graph matchings greedy sortings

B'Every year Santa Claus gives gifts to all children. However, each country has its own traditions, and this process takes place in different ways. For example, in Berland you need to solve the New Year 's puzzle. Polycarp got the following problem: given a grid strip of size 2 x n , some cells of it are blocked. You need to check if it is possible to tile all free cells using the 2 x 1 and 1 x 2 tiles (dominoes). For example, if n = 5 and the strip looks like this (black cells are blocked): Then it can be tiled, for example, using two vertical and two horizontal tiles, as in the picture below (different tiles are marked by different colors). And if n = 3 and the strip looks like this: It is impossible to tile free cells. Polycarp easily solved this task and received his New Year 's gift. Can you solve it? The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Then t test cases follow. Each test case is preceded by an empty line. The first line of each test case contains two integers n and m ( 1 <= n <= 10^9 , 1 <= m <= 2 cdot 10^5 ) -- the length of the strip and the number of blocked cells on it. Each of the next m lines contains two integers r_i, c_i ( 1 <= r_i <= 2, 1 <= c_i <= n ) -- numbers of rows and columns of blocked cells. It is guaranteed that all blocked cells are different, i.e. (r_i, c_i) ne (r_j, c_j), i ne j . It is guaranteed that the sum of m over all test cases does not exceed 2 cdot 10^5 . For each test case, print on a separate line: You can output "YES" and "NO" in any case (for example, the strings yEs, yes, Yes and YES will be recognized as positive). The first two test cases are explained in the statement. In the third test case the strip looks like this: '...

Tutorials

Codeforces Round #693 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
103337924 20050901 F Jan. 5, 2021, 3:09 a.m. OK GNU C++11 TESTS 9 31 2457600
103336978 zorbin F Jan. 5, 2021, 2:40 a.m. OK GNU C++11 TESTS 9 61 1433600
103340394 iyua F Jan. 5, 2021, 4:09 a.m. OK GNU C++11 TESTS 9 62 1638400
103345510 Rainer1116 F Jan. 5, 2021, 5:57 a.m. OK GNU C++11 TESTS 9 62 11878400
103336927 Dreamfarer F Jan. 5, 2021, 2:39 a.m. OK GNU C++11 TESTS 9 78 4505600
103315339 johnson10024 F Jan. 4, 2021, 6:07 p.m. OK GNU C++11 TESTS 9 124 8192000
103308626 Magi F Jan. 4, 2021, 5:07 p.m. OK GNU C++11 TESTS 9 139 5632000
103344457 AA_Surely F Jan. 5, 2021, 5:43 a.m. OK GNU C++11 TESTS 9 140 1126400
103311737 anhtaihsgs F Jan. 4, 2021, 5:31 p.m. OK GNU C++11 TESTS 9 140 1126400
103320216 CoDeHuNtEr F Jan. 4, 2021, 7:07 p.m. OK GNU C++11 TESTS 9 155 6348800

remove filters

Back to search problems