# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28108 | EyeOfSol (#71) | The City and The Bitcoin (FXCUP2_city) | C++11 | 16 ms | 2768 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;
int mat[310][310];
int dyn[310][310];
int main() {
int n, m;
scanf("%d%d",&n,&m);
swap(n,m);
int i, j;
for (i=0;i<n;i++) for (j=0;j<m;j++) scanf("%d",&mat[i][j]);
dyn[n-1][m-1] = 1;
for (i=n-1;i>=0;i--) {
for (j=m-1;j>=0;j--) {
if (i==n-1&&j==m-1) continue;
dyn[i][j] = (mat[i][j])&&(dyn[i+1][j]||dyn[i][j+1]);
}
}
if (dyn[0][0]) printf("Yes\n");
else printf("No\n");
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |