# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
391162 | keta_tsimakuridze | Furniture (JOI20_furniture) | C++14 | 2301 ms | 36732 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define f first
#define int long long
#define s second
using namespace std;
const int N=1005,mod=1e9+7;
int t,d2[N][N],d1[N][N],p[N][N],n,m,cnt[2*N];
queue<pair<int,int> > q;
char c[N][N];
bool ok(int x,int y){
if(min(x,y)<1 || x>n || y>m) return 0;
return 1;
}
void dfs1(int x,int y){
if(d1[x][y] || c[x][y]=='1') return;
d1[x][y]=1;
if(ok(x+1,y)) dfs1(x+1,y);
if(ok(x,y+1)) dfs1(x,y+1);
}
void dfs2(int x,int y){
if(d2[x][y] || c[x][y]=='1') return;
d2[x][y]=1;
if(ok(x-1,y)) dfs2(x-1,y);
if(ok(x,y-1)) dfs2(x,y-1);
}
void update1(int x,int y){
if(ok(x+1,y) && p[x+1][y] && !p[x+1][y-1]) q.push({x+1,y});
if(ok(x,y+1) && p[x][y+1] && !p[x-1][y+1]) q.push({x,y+1});
while(q.size()){
x=q.front().f;
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |