답안 #591540

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
591540 2022-07-07T14:47:38 Z MDario 게임 (APIO22_game) C++17
2 / 100
6 ms 7252 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&&v<=u)r=1;
        else if(!e[v]){
            dfs(v);
        }
    }
    else ad[u].push_back(v);
    return r;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7248 KB Output is correct
2 Correct 4 ms 7248 KB Output is correct
3 Correct 4 ms 7248 KB Output is correct
4 Correct 5 ms 7248 KB Output is correct
5 Correct 4 ms 7248 KB Output is correct
6 Correct 6 ms 7248 KB Output is correct
7 Correct 6 ms 7248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7248 KB Output is correct
2 Correct 4 ms 7248 KB Output is correct
3 Correct 4 ms 7248 KB Output is correct
4 Correct 5 ms 7248 KB Output is correct
5 Correct 4 ms 7248 KB Output is correct
6 Correct 6 ms 7248 KB Output is correct
7 Correct 6 ms 7248 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 6 ms 7248 KB Output is correct
10 Correct 4 ms 7248 KB Output is correct
11 Incorrect 5 ms 7248 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7248 KB Output is correct
2 Correct 4 ms 7248 KB Output is correct
3 Correct 4 ms 7248 KB Output is correct
4 Correct 5 ms 7248 KB Output is correct
5 Correct 4 ms 7248 KB Output is correct
6 Correct 6 ms 7248 KB Output is correct
7 Correct 6 ms 7248 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 6 ms 7248 KB Output is correct
10 Correct 4 ms 7248 KB Output is correct
11 Incorrect 5 ms 7248 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7248 KB Output is correct
2 Correct 4 ms 7248 KB Output is correct
3 Correct 4 ms 7248 KB Output is correct
4 Correct 5 ms 7248 KB Output is correct
5 Correct 4 ms 7248 KB Output is correct
6 Correct 6 ms 7248 KB Output is correct
7 Correct 6 ms 7248 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 6 ms 7248 KB Output is correct
10 Correct 4 ms 7248 KB Output is correct
11 Incorrect 5 ms 7248 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 7248 KB Output is correct
2 Correct 4 ms 7248 KB Output is correct
3 Correct 4 ms 7248 KB Output is correct
4 Correct 5 ms 7248 KB Output is correct
5 Correct 4 ms 7248 KB Output is correct
6 Correct 6 ms 7248 KB Output is correct
7 Correct 6 ms 7248 KB Output is correct
8 Correct 4 ms 7252 KB Output is correct
9 Correct 6 ms 7248 KB Output is correct
10 Correct 4 ms 7248 KB Output is correct
11 Incorrect 5 ms 7248 KB Wrong Answer[1]
12 Halted 0 ms 0 KB -