# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
396387 | srvlt | Collider (IZhO11_collider) | C++17 | 238 ms | 48964 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 ll long long
#define pb push_back
#define all(x) begin(x),end(x)
#define ld long double
#define SZ(x) (int)(x).size()
#define mem(x,y) memset(&x,y,sizeof(x))
#define np nullptr
using namespace std;
mt19937 rng(chrono::steady_clock().now().time_since_epoch().count());
uniform_int_distribution<int> _p(0,(int)1e9);
namespace treap {
struct Node {
int p,sz=1;
char c;
Node *l=np,*r=np;
Node() {}
Node(char _c) { c=_c,p=_p(rng); }
};
typedef Node* node;
int sz(node v) { return v?v->sz:0; }
void upd(node v) {
if(!v) return;
v->sz=sz(v->l)+sz(v->r)+1;
}
node merge(node l,node r){
if(!l) return r;
if(!r) return l;
if(l->p < r->p) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |