# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96447 | choikiwon | Bomb (IZhO17_bomb) | C++17 | 1045 ms | 108224 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;
typedef pair<int, int> pii;
const int MN = 2525;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int N, M;
char G[MN][MN];
int cc[MN][MN][4];
int dp(int r, int c, int d) {
if(r < 0 || N <= r || c < 0 || M <= c) return 0;
int &ret = cc[r][c][d];
if(ret != -1) return ret;
if(G[r][c] == '0') return ret = 0;
return ret = dp(r + dy[d], c + dx[d], d) + 1;
}
vector<int> V[MN];
int mn[MN];
int main() {
scanf("%d %d", &N, &M);
for(int i = 0; i < N; i++) {
scanf("\n");
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |