이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define sz(a) (int)a.size()
#define all(x) (x).begin(), (x).end()
vector<bool> vist;
int k, n;
vector<vector<int>> adj;
void init(int N, int K) {
k=K; n=N;
adj.resize(n);
for(int i=0; i<k-1; i++) adj[i].pb(i+1);
}
int s(int x){
if(vist[x]){
if(x<k){
return 1;
}
return 0;
}
vist[x]=1;
for(auto& u : adj[x]){
if(s(u)==1) return 1;
}
return 0;
}
int add_teleporter(int u, int v) {
vist.assign(n, 0);
adj[u].pb(v);
return s(0);
}
# | 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... |