Pinely Round 5 (Div. 1 + Div. 2)

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
2161 Pinely Round 5 (Div. 1 + Div. 2) FINISHED False 10800 14563523 Oct. 30, 2025, 4:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 5337 ) B Make Connected PROGRAMMING brute force dsu implementation

You are given an (n \times n) grid where some cells are colored black, and the rest are white. You may paint some of the white cells black to achieve the following conditions: There is at least one black cell. All black cells must be orthogonally connected, that is, it should be possible to go from any black cell to any other by crossing several vertical or horizontal cell borders while visiting only black cells. You can't go directly through the corner of a cell. There are no three consecutive black cells aligned vertically or horizontally. You can't paint black cells white. Determine whether it is possible to paint some white cells black in order to satisfy all the conditions. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The first line contains an integer (n) ((1 \leq n \leq 100)) — the size of the grid. The following (n) lines contain (n) characters each — the grid description, where each character represents a cell: . — a white cell; # — a black cell. It is guaranteed that the sum of (n) over all test cases does not exceed (2000). For each test case, print " YES " if it is possible to paint some white cells black to satisfy all the conditions, and " NO " otherwise. You may print each letter in any case (uppercase or lowercase). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will all be recognized as a positive answer. In the first test case, there are no black cells, so we must paint one cell black. In the second and third test cases, the grid satisfies all the conditions from the very beginning. In the fourth test case, one of the possible solutions is: In the fifth test case, the grid violates the " No three consecutive black cells should be aligned vertically or horizontally " condition from the very beginning, so there is no solution. In the sixth test case, it can be shown that it is

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
346721661 ksandr1v B Oct. 30, 2025, 6:44 p.m. OK C# 13 TESTS 13 124 2969600
346773722 Anmol.rai B Oct. 31, 2025, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346772840 voluntarism B Oct. 31, 2025, 5:52 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346772753 Code937 B Oct. 31, 2025, 5:51 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346772017 MMamun B Oct. 31, 2025, 5:44 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346770361 devecent B Oct. 31, 2025, 5:26 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346769855 CerCer B Oct. 31, 2025, 5:20 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346767835 Kekan B Oct. 31, 2025, 4:57 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346762831 little_happy B Oct. 31, 2025, 3:59 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346762291 JattzzKun B Oct. 31, 2025, 3:52 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346762142 ihgazi B Oct. 31, 2025, 3:51 a.m. OK C++17 (GCC 7-32) TESTS 13 46 0
346771231 Natsu B Oct. 31, 2025, 5:35 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346764654 HCCoder B Oct. 31, 2025, 4:19 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346760087 ezeba04 B Oct. 31, 2025, 3:26 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346759907 Deep_Sea_Explorer B Oct. 31, 2025, 3:24 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346756641 kunalnishanttyagi B Oct. 31, 2025, 2:30 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346753337 snowythecat B Oct. 31, 2025, 1:27 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346751874 ro_.hi__th._ B Oct. 31, 2025, 12:54 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346751238 DogAndCat B Oct. 31, 2025, 12:37 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346750669 trivialkid B Oct. 31, 2025, 12:21 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346750379 Misaki_Foracy_ B Oct. 31, 2025, 12:14 a.m. OK C++20 (GCC 13-64) TESTS 13 46 0
346756558 hungchi17 B Oct. 31, 2025, 2:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 31 0
346754300 EurekaJJ B Oct. 31, 2025, 1:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 31 0
346773688 jiangbowen B Oct. 31, 2025, 6:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346773083 npp4678 B Oct. 31, 2025, 5:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346772936 suvam01 B Oct. 31, 2025, 5:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346772218 Saviour26 B Oct. 31, 2025, 5:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346772162 Slim-Sulek B Oct. 31, 2025, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346771761 Pranvesh B Oct. 31, 2025, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346770699 DarkMatrix B Oct. 31, 2025, 5:29 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346770587 manoJaat_3003 B Oct. 31, 2025, 5:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 13 46 0
346752964 Andrew_G6 B Oct. 31, 2025, 1:19 a.m. OK GNU C11 TESTS 13 46 102400
346745567 Andrew_G6 B Oct. 30, 2025, 10:12 p.m. OK GNU C11 TESTS 13 46 102400
346744414 Andrew_G6 B Oct. 30, 2025, 9:50 p.m. OK GNU C11 TESTS 13 46 102400
346723473 1435730 B Oct. 30, 2025, 6:51 p.m. OK GNU C11 TESTS 13 62 102400
346715314 ri_mu39 B Oct. 30, 2025, 6:22 p.m. OK GNU C11 TESTS 13 62 204800
346731651 ICPCCode B Oct. 30, 2025, 7:25 p.m. OK GNU C11 TESTS 13 859 307200
346741451 arvind_pathak B Oct. 30, 2025, 9:02 p.m. OK GNU C11 TESTS 13 1483 1638400
346736497 mastacoda B Oct. 30, 2025, 8:05 p.m. OK Java 21 TESTS 13 233 921600
346751322 sohxm2k B Oct. 31, 2025, 12:39 a.m. OK Java 21 TESTS 13 249 716800
346740677 WrongAnswerOnTestCase2 B Oct. 30, 2025, 8:52 p.m. OK Java 21 TESTS 13 249 716800
346728930 GuLLu05 B Oct. 30, 2025, 7:14 p.m. OK Java 21 TESTS 13 249 1126400
346724839 keshav_.agg B Oct. 30, 2025, 6:56 p.m. OK Java 21 TESTS 13 249 1228800
346770276 tekka_ity B Oct. 31, 2025, 5:25 a.m. OK Java 21 TESTS 13 249 1331200
346739124 Balu2907 B Oct. 30, 2025, 8:33 p.m. OK Java 21 TESTS 13 264 716800
346753678 kartik__sethi B Oct. 31, 2025, 1:35 a.m. OK Java 21 TESTS 13 265 819200
346760002 shiva___np B Oct. 31, 2025, 3:25 a.m. OK Java 21 TESTS 13 265 1024000
346741546 kpiyush1024 B Oct. 30, 2025, 9:03 p.m. OK Java 21 TESTS 13 265 1228800
346745965 SoMeQuit B Oct. 30, 2025, 10:20 p.m. OK Java 8 TESTS 13 140 0
346773228 gua069 B Oct. 31, 2025, 5:56 a.m. OK Java 8 TESTS 13 155 0
346771049 Vishalll_ B Oct. 31, 2025, 5:33 a.m. OK Java 8 TESTS 13 187 0
346724577 abhayrajnegi0416 B Oct. 30, 2025, 6:55 p.m. OK Java 8 TESTS 13 218 0
346713241 eZermelo B Oct. 30, 2025, 6:16 p.m. OK Kotlin 2.2 TESTS 13 312 1331200
346729113 DSKroc B Oct. 30, 2025, 7:14 p.m. OK PyPy 3 TESTS 13 156 134553600
346718653 toryinside B Oct. 30, 2025, 6:33 p.m. OK PyPy 3 TESTS 13 249 8192000
346718718 bradyji2006 B Oct. 30, 2025, 6:33 p.m. OK PyPy 3 TESTS 13 265 7782400
346753399 stan23456 B Oct. 31, 2025, 1:28 a.m. OK PyPy 3-64 TESTS 13 108 2355200
346746033 DT4V B Oct. 30, 2025, 10:22 p.m. OK PyPy 3-64 TESTS 13 109 2969600
346744464 gardengnome B Oct. 30, 2025, 9:51 p.m. OK PyPy 3-64 TESTS 13 109 5939200
346763284 Aayush_69 B Oct. 31, 2025, 4:03 a.m. OK PyPy 3-64 TESTS 13 109 8806400
346737806 RobinFromTheHood B Oct. 30, 2025, 8:17 p.m. OK PyPy 3-64 TESTS 13 124 6553600
346737095 jigitmax B Oct. 30, 2025, 8:11 p.m. OK PyPy 3-64 TESTS 13 124 9420800
346768986 Muhammad-Mutahir B Oct. 31, 2025, 5:11 a.m. OK PyPy 3-64 TESTS 13 124 10035200
346736434 shadow4720 B Oct. 30, 2025, 8:04 p.m. OK PyPy 3-64 TESTS 13 125 6348800
346726945 Lets_Try_ B Oct. 30, 2025, 7:05 p.m. OK PyPy 3-64 TESTS 13 139 2867200
346754016 Pi213 B Oct. 31, 2025, 1:41 a.m. OK PyPy 3-64 TESTS 13 140 3891200
346751300 arroa03 B Oct. 31, 2025, 12:38 a.m. OK Python 3 TESTS 13 93 1331200
346747746 Eng_Ahmed_Saleh B Oct. 30, 2025, 11:02 p.m. OK Python 3 TESTS 13 93 2252800
346715444 ariam_ B Oct. 30, 2025, 6:23 p.m. OK Python 3 TESTS 13 108 1740800
346739740 iammmann B Oct. 30, 2025, 8:40 p.m. OK Rust 2024 TESTS 13 46 0
346719568 WORTH B Oct. 30, 2025, 6:36 p.m. OK Rust 2024 TESTS 13 62 0
346750257 vmhung B Oct. 31, 2025, 12:11 a.m. OK Rust 2024 TESTS 13 62 102400
346722657 _JG_ B Oct. 30, 2025, 6:48 p.m. OK Rust 2024 TESTS 13 77 0
346744772 pradeep027 B Oct. 30, 2025, 9:56 p.m. OK Rust 2024 TESTS 13 77 102400

remove filters

Back to search problems