# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1141118 | SmuggingSpun | Furniture (JOI20_furniture) | C++20 | 1 ms | 324 KiB |
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
int n, m;
namespace sub1{
void solve(){
vector<vector<bool>>c(n, vector<bool>(m, false));
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
int x;
cin >> x;
if(x == 1){
c[i][j] = true;
}
}
}
int q;
cin >> q;
for(int _ = 0; _ < q; _++){
int x, y;
cin >> x >> y;
c[--x][--y] = true;
vector<vector<bool>>vis(n, vector<bool>(m, false));
auto dfs = [&] (auto&& self, int x, int y){
if(x < 0 || x == n || y < 0 || y == m || vis[x][y] || c[x][y]){
return;
}
vis[x][y] = true;
self(self, x + 1, y);
self(self, x, y + 1);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |