# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
508782 | nichke | Furniture (JOI20_furniture) | C++14 | 381 ms | 27852 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// 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... |