# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293302 | fake_account | Furniture (JOI20_furniture) | C++14 | 299 ms | 6380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long
const int N = 1005;
int n, m, q, g[N][N], s[2 * N];
void gogo(int x, int y);
void go(int x, int y){
if((x == 1 && y == 1) || (x == n && y == m)) return;
if(g[x][y] == 1) return;
if((g[x - 1][y] && g[x][y - 1]) || (g[x + 1][y] && g[x][y + 1])){
gogo(x, y);
}
}
void gogo(int x, int y){
if(g[x][y] == 1) return;
g[x][y] = 1;
s[x + y]--;
go(x - 1, y);
go(x, y - 1);
go(x + 1, y);
go(x, y + 1);
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |