# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172991 | Petrix | Furniture (JOI20_furniture) | C++20 | 126 ms | 6240 KiB |
#include <iostream>
using namespace std;
int n,m;
int v[1001][1001];
int diag[2002];
bool in(int l,int c){
return (l>0 && c>0 && l<=n && c<=m);
}
void update(int l,int c);
void dfs(int l,int c){
if(!v[l+1][c-1]) {
update(l,c-1);
update(l+1,c);
}
if(!v[l-1][c+1]) {
update(l,c+1);
update(l-1,c);
}
}
void update(int l,int c){
///cout<<l<<" "<<c<<"|";
if(v[l][c]){
diag[l+c]--;v[l][c]=0;
dfs(l,c);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |