# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202911 | Mercenary | Collapse (JOI18_collapse) | C++14 | 4648 ms | 53356 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> Q[maxn];
int type[maxn] , x[maxn] , y[maxn];
int p[maxn] , w[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... |