# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
578243 | handlename | Game (APIO22_game) | C++17 | 4014 ms | 45468 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;
#define pb push_back
#define mp make_pair
const int MOD=1e9+7;
int n,k;
vector<int> adj[300001],rev[300001];
pair<int,int> range[300001];
//rightmost special node to go i, leftmost special node i can go to
void init(int N,int K){
n=N;
k=K;
for (int i=1;i<=k;i++){
//adj[i].pb(i+1);
//rev[i+1].pb(i);
range[i]=mp(i,i);
}
for (int i=k+1;i<=n;i++){
range[i]=mp(0,k+1);
}
}
bool upd(int u,int v){
if (range[u].second<=range[v].first) return false;
if (range[u].first>=range[v].second) return true;
if (range[u]==range[v]) return false;
//u1 u u2
//v1 v v2
//u2>v1 and u1<v2
//if we use u->v edge,v1=max(u1,v1) and u2=min(u2,v2)
if (range[u].first>range[v].first){
# | 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... |