# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
999292 | vjudge1 | LOSTIKS (INOI20_lostiks) | C++17 | 2055 ms | 29940 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>
#define int long long
// #define ll long long
#define pii pair<int, int>
#define all(v) v.begin(), v.end()
using namespace std;
const int oo = 1e18 + 9;
const int MAX = 1e5 + 5, LOGMAX = 20, B = 800, MOD = 1e9 + 7;
vector<array<int, 3>> d;
int n, S, T;
int org[MAX];
struct DSU{
int par[MAX];
void init(){
memset(par, -1, sizeof(par));
}
int get(int u){
if(par[u] < 0) return u;
return get(par[u]);
}
stack<int> st;
void unite(int u, int v, bool b){
u = get(u), v = get(v);
if(u == v) return;
if(-par[u] < -par[v]) swap(u, v);
if(b){
st.push(u);
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... |