Submission #591528

# Submission time Handle Problem Language Result Execution time Memory
591528 2022-07-07T14:39:14 Z MDario Game (APIO22_game) C++17
0 / 100
5 ms 7344 KB
#include "game.h"
#include<bits/stdc++.h>
using namespace std;
int n, k;
bitset<300000> e;
vector<int> ad[300000];
bool r=0;
void dfs(int xf){
    e[xf]=1;
    for(auto i : ad[xf]){
        if(i<k)r=1;
        else if(!e[i])dfs(i);
    }
    return;
}
void init(int N, int K) {
    n=N;
    k=K;
    for(int i=0; i<k; i++)e[i]=1;
    return;
}

int add_teleporter(int u, int v) {
    if(r)return 1;
    if(e[u]){
        if(v<k)r=1;
        else if(!e[v]){
            dfs(v);
        }
    }
    else ad[u].push_back(v);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 7344 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 7344 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 7344 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 7344 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 7344 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -