# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
508782 | nichke | Furniture (JOI20_furniture) | C++14 | 381 ms | 27852 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.
// I may fail a thousand times
// But there is no giving up
// IOI - here I come
#include <bits/stdc++.h>
#define int long long
using namespace std;
queue<int> q;
map<int,int> mp;
int v[(int)1e3+5][(int)1e3+5];
int a[(int)1e3+5][(int)1e3+5];
void push(int x,int y){
if(a[x][y])return;
q.push(x);q.push(y);
a[x][y]=1;
mp[x+y]--;
}
int upd(int x,int y){
if(a[x][y])return 1;
if(mp[x+y]==1)return 0;
mp[x+y]--;
a[x][y]=1;
q.push(x);
q.push(y);
for(;!q.empty();){
int nx=q.front();q.pop();
int ny=q.front();q.pop();
if(a[nx+1][ny-1])push(nx+1,ny),push(nx,ny-1);
if(a[nx-1][ny+1])push(nx-1,ny),push(nx,ny+1);
}
return 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |