# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96206 | JaeyunK | 문명 (KOI17_civilization) | C++11 | 930 ms | 42640 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 <queue>
#include <algorithm>
using namespace std;
class data{
public:
int x, y, rk;
data(){}
data(int _x, int _y, int _r):x(_x),y(_y),rk(_r){}
};
int arr[2005][2005], rarr[2005][2005], par[100010], psz[100010], pos[2][4] = {{0, 0, 1, -1}, {1, -1, 0, 0}};
queue<data> que;
int getPar(int x){
if(par[x] == x) return x;
return par[x] = getPar(par[x]);
}
int main(){
int n, k, a, b;
scanf("%d %d", &n, &k);
for(int i=1; i<=k; i++){
scanf("%d %d", &a, &b);
par[i] = i;
psz[i] = 1;
arr[a][b] = i;
rarr[a][b] = 1;
que.push({a, b, 1});
}
while(!que.empty()){
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... |