# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
292911 | arnold518 | Furniture (JOI20_furniture) | C++14 | 936 ms | 38068 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2000;
int N, M, Q, A[MAXN+10][MAXN+10];
int dp1[MAXN+10][MAXN+10], dp2[MAXN+10][MAXN+10];
int S[MAXN+10][MAXN+10], C[MAXN+10];
int main()
{
scanf("%d%d", &N, &M);
for(int i=1; i<=N; i++) for(int j=1; j<=M; j++) scanf("%d", &A[i][j]);
for(int i=1; i<=N; i++) for(int j=1; j<=M; j++)
{
if(i==1 && j==1) dp1[i][j]=1;
else if(A[i][j]) dp1[i][j]=0;
else dp1[i][j]=dp1[i-1][j]|dp1[i][j-1];
}
for(int i=N; i>=1; i--) for(int j=M; j>=1; j--)
{
if(i==N && j==M) dp2[i][j]=1;
else if(A[i][j]) dp2[i][j]=0;
else dp2[i][j]=dp2[i+1][j]|dp2[i][j+1];
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |