제출 #982703

#제출 시각아이디문제언어결과실행 시간메모리
982703vjudge1게임 (APIO22_game)C++17
0 / 100
0 ms344 KiB
#include "game.h" #include <algorithm> #include <fstream> #include <vector> #include <queue> #include <stack> #include <iostream> #include <cmath> #include <queue> #include <set> #include <string> #include <cstring> #include <map> #include <unordered_map> #include <unordered_set> #define F first #define S second #define PB push_back using namespace std; const long long MOD=1e9+7, INF=1e18; const int INFI=1e9; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<pair<int, ii>> viii; typedef vector<vii> vvii; typedef vector<ll> vll; typedef vector<vll> vvll; int n, k; vvi al; bool vis[300005]; void init(int N, int K){ n=N; k=K; al.resize(n+1, vi()); for(int i=0;i<k-1;i++) al[i].PB(i+1); } bool dfs(int node){ bool ans=false; if(vis[node] && node<k) return 1; else if(vis[node]) return 0; vis[node]=true; for(auto ch:al[node]){ if(dfs(ch)) ans=true; } return ans; } int add_teleporter(int u, int v){ al[u].PB(v); for(int i=0;i<k;i++){ memset(vis, false, n+1); if(dfs(i)) return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...