# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
108946 | ihdignite | Bomb (IZhO17_bomb) | C++14 | 1096 ms | 132096 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;
const int mxN=2500;
int n, m, mc=mxN, ans, p[mxN*mxN], s[mxN*mxN];
string g[mxN];
vector<array<int, 2>> ta[mxN+1];
priority_queue<int, vector<int>, greater<int>> pq1, pq2;
int find(int x) {
return x==p[x]?x:(p[x]=find(p[x]));
}
void join(int x, int y) {
if((x=find(x))==(y=find(y)))
return;
if(s[x]<s[y])
swap(x, y);
p[y]=x;
pq2.push(s[x]);
pq2.push(s[y]);
s[x]+=s[y];
pq1.push(s[x]);
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |