# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
74356 | khsoo01 | The City and The Bitcoin (FXCUP2_city) | C++11 | 17 ms | 2292 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int N = 305;
int n, m, a[N][N];
void dfs (int X, int Y) {
if(!a[X][Y]) return;
a[X][Y] = 0;
dfs(X+1, Y); dfs(X, Y+1);
}
int main()
{
scanf("%d%d",&m,&n);
for(int i=1;i<=n;i++) {
for(int j=1;j<=m;j++) {
scanf("%d",&a[i][j]);
}
}
dfs(1, 1);
puts(a[n][m]?"No":"Yes");
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |