# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1041237 | Maite_Morale | Stranded Far From Home (BOI22_island) | C++17 | 312 ms | 53844 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;
#define vll vector<ll>
#define MAX 500005
#define pll pair<ll,ll>
#define F first
#define S second
vll v[MAX],r[MAX];
ll n,m,t,k,a[MAX],p[MAX],ans[MAX];
pll ord[MAX];
ll fnd(ll x){
// cout<<x<<p[x]<<"{\n";
if(p[x]==x){
// cout<<x<<"}\n";
return p[x];
}
p[x]=fnd(p[x]);
// cout<<x<<"}\n";
return p[x];
}
void uni(ll x,ll y){
x=fnd(x);y=fnd(y);
if(fnd(x)==fnd(y))return;
a[y]+=a[x];
p[x]=y;
}
int main(){
cin>>n>>m;map<ll,ll> mp;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |