Codeforces Round 766 (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
1627 Codeforces Round 766 (Div. 2) FINISHED False 7200 94922663 Jan. 15, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 24217 ) A Not Shading PROGRAMMING constructive algorithms implementation

B"There is a grid with n rows and m columns. Some cells are colored black, and the rest of the cells are colored white. In one operation, you can select some black cell and do exactly one of the following: You are given two integers r and c . Find the minimum number of operations required to make the cell in row r and column c black, or determine that it is impossible. The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains four integers n , m , r , and c ( 1 <= q n, m <= q 50 ; 1 <= q r <= q n ; 1 <= q c <= q m ) -- the number of rows and the number of columns in the grid, and the row and column of the cell you need to turn black, respectively. Then n lines follow, each containing m characters. Each of these characters is either 'B' or 'W' -- a black and a white cell, respectively. For each test case, if it is impossible to make the cell in row r and column c black, output -1 . Otherwise, output a single integer -- the minimum number of operations required to make the cell in row r and column c black. The first test case is pictured below. We can take the black cell in row 1 and column 2 , and make all cells in its row black. Therefore, the cell in row 1 and column 4 will become black. In the second test case, the cell in row 2 and column 1 is already black. In the third test case, it is impossible to make the cell in row 2 and column 2 black. The fourth test case is pictured below. We can take the black cell in row 2 and column 2 and make its column black. Then, we can take the black cell in row 1 and column 2 and make its row black. Therefore, the cell in row 1 and column 1 will become"...

Tutorials

Codeforces Round #766 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
142913316 Ziyoda A Jan. 16, 2022, 4:54 a.m. OK Clang++17 Diagnostics TESTS 8 93 0
142905227 _sdsssd11 A Jan. 16, 2022, 1:11 a.m. OK Clang++17 Diagnostics TESTS 8 124 0
142905945 alittleprincess A Jan. 16, 2022, 1:39 a.m. OK Clang++17 Diagnostics TESTS 8 155 0
142905922 alittleprincess A Jan. 16, 2022, 1:38 a.m. OK Clang++17 Diagnostics TESTS 8 202 0
142889318 ssatendra790 A Jan. 15, 2022, 6:03 p.m. OK Clang++17 Diagnostics TESTS 8 233 0
142905903 xiayichen A Jan. 16, 2022, 1:38 a.m. OK GNU C++14 TESTS 8 0 0
142905147 FSTAutoMaton A Jan. 16, 2022, 1:08 a.m. OK GNU C++14 TESTS 8 0 0
142904687 yspm A Jan. 16, 2022, 12:44 a.m. OK GNU C++14 TESTS 8 0 0
142903069 rvtkatkam A Jan. 15, 2022, 11:19 p.m. OK GNU C++14 TESTS 8 0 0
142894512 DaVinci A Jan. 15, 2022, 7:14 p.m. OK GNU C++14 TESTS 8 0 0
142893215 u1904123 A Jan. 15, 2022, 6:53 p.m. OK GNU C++14 TESTS 8 0 0
142912252 Mr_unique123 A Jan. 16, 2022, 4:32 a.m. OK GNU C++14 TESTS 8 0 0
142911777 sauravbhartibgs37 A Jan. 16, 2022, 4:22 a.m. OK GNU C++14 TESTS 8 0 0
142911687 Hope2820 A Jan. 16, 2022, 4:20 a.m. OK GNU C++14 TESTS 8 0 0
142906558 Phoenix-Cat A Jan. 16, 2022, 2:02 a.m. OK GNU C++14 TESTS 8 0 0
142896587 suraj A Jan. 15, 2022, 7:53 p.m. OK .NET Core C# TESTS 8 93 1843200

remove filters

Back to search problems