# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
599266 | 2022-07-19T12:12:47 Z | jmyszka2007 | Furniture (JOI20_furniture) | C++17 | 5000 ms | 10144 KB |
#include <bits/stdc++.h> using namespace std; int vis[1010][1010]; int meb[1010][1010]; int n, m; void dfs(int x, int y) { if(x > n || y > m || vis[x][y]) { return; } vis[x][y] = 1; dfs(x + 1, y); dfs(x, y + 1); } int main() { scanf("%d%d", &n, &m); for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { scanf("%d", &meb[i][j]); } } int t; scanf("%d", &t); while(t--) { for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { vis[i][j] = meb[i][j]; } } int a, b; scanf("%d%d", &a, &b); vis[a][b] = 1; dfs(1, 1); if(vis[n][m]) { printf("%d\n", 1); meb[a][b] = 1; } else { printf("%d\n", 0); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 852 KB | Output is correct |
2 | Correct | 14 ms | 1112 KB | Output is correct |
3 | Correct | 48 ms | 1020 KB | Output is correct |
4 | Correct | 78 ms | 1052 KB | Output is correct |
5 | Correct | 85 ms | 1108 KB | Output is correct |
6 | Correct | 151 ms | 1108 KB | Output is correct |
7 | Correct | 58 ms | 1116 KB | Output is correct |
8 | Correct | 72 ms | 1108 KB | Output is correct |
9 | Correct | 158 ms | 1108 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 852 KB | Output is correct |
2 | Correct | 14 ms | 1112 KB | Output is correct |
3 | Correct | 48 ms | 1020 KB | Output is correct |
4 | Correct | 78 ms | 1052 KB | Output is correct |
5 | Correct | 85 ms | 1108 KB | Output is correct |
6 | Correct | 151 ms | 1108 KB | Output is correct |
7 | Correct | 58 ms | 1116 KB | Output is correct |
8 | Correct | 72 ms | 1108 KB | Output is correct |
9 | Correct | 158 ms | 1108 KB | Output is correct |
10 | Correct | 2167 ms | 928 KB | Output is correct |
11 | Correct | 84 ms | 760 KB | Output is correct |
12 | Execution timed out | 5068 ms | 10144 KB | Time limit exceeded |
13 | Halted | 0 ms | 0 KB | - |