# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148042 | arnold518 | 문명 (KOI17_civilization) | C++14 | 1079 ms | 52444 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 long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2000;
const int MAXK = 1e5;
const int dy[]={-1, 1, 0, 0};
const int dx[]={0, 0, -1, 1};
int N, K, A[MAXN+10][MAXN+10];
int conv(int y, int x) { return (y-1)*N+(x-1); }
int par[MAXN*MAXN+10], Rank[MAXN*MAXN+10], cnt=0, ans;
int Find(int x) { return x==par[x]?x:par[x]=Find(par[x]); }
void Union(int x, int y)
{
x=Find(x); y=Find(y);
if(Rank[x]<Rank[y]) swap(x, y);
if(Rank[x]==Rank[y]) Rank[x]++;
par[y]=x;
}
struct Queue { int y, x; };
queue<Queue> Q;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |