# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
261690 | ttnhuy313 | Collapse (JOI18_collapse) | C++14 | 4759 ms | 54056 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.
#ifndef LOCAL
#include "collapse.h"
#endif // LOCAL
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 1e5 + 5;
typedef pair<int,int> ii;
int n , m , q;
vector<int> qList[maxn];
int type[maxn] , from[maxn] , to[maxn];
int cliff_at[maxn] , date[maxn];
int in[maxn] , out[maxn];
int res[maxn];
struct Dsurollback{
pair<int*,int> data[(int)2e6];
int lab[maxn] , sz;
int FindLab(int u){
return lab[u] < 0 ? u : FindLab(lab[u]);
}
void Change(int & u , int v){
data[sz++] = mp(&u,u);
u = v;
}
void rollback(int sz1){
while(sz > sz1){
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |