# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
388284 | patrikpavic2 | Bomb (IZhO17_bomb) | C++17 | 635 ms | 90316 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 <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#define PB push_back
using namespace std;
const int N = 2505;
int n, m;
char s[N][N];
int A[N][N], B[N][N];
int par[N], L[N], R[N], un[N], nula[N];
int S[N];
int pr(int x){
if(x == par[x]) return x;
return par[x] = pr(par[x]);
}
void mrg(int x, int y){
if(x < 0 || y >= m || !un[x] || !un[y]) return;
// printf("mrg %d %d\n", x, y);
x = pr(x), y = pr(y);
if(x == y) return;
if(nula[x]) S[R[x] - L[x] + 1]--;
if(nula[y]) S[R[y] - L[y] + 1]--;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |