| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 293759 | BThero | Furniture (JOI20_furniture) | C++17 | 5049 ms | 1016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// chrono::system_clock::now().time_since_epoch().count()
#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAXN = (int)1e3 + 5;
const int MAXM = (int)1e6 + 9;
int dp[MAXN][MAXN];
char s[MAXN][MAXN];
int n, m, q;
void solve() {
scanf("%d %d", &n, &m);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
scanf(" %c", &s[i][j]);
}
}
scanf("%d", &q);
for (int i = 1; i <= q; ++i) {
int x, y;
scanf("%d %d", &x, &y);
--x;
--y;
s[x][y] = '1';
for (int x = n - 1; ~x; --x) {
for (int y = m - 1; ~y; --y) {
if (x == n - 1 && y == m - 1) {
dp[x][y] = 1;
continue;
}
dp[x][y] = 0;
if (s[x][y] != '1') {
dp[x][y] |= dp[x + 1][y];
dp[x][y] |= dp[x][y + 1];
}
}
}
if (dp[0][0]) {
printf("1\n");
}
else {
printf("0\n");
s[x][y] = '0';
}
}
}
int main() {
int tt = 1;
while (tt--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
