Submission #742570

#TimeUsernameProblemLanguageResultExecution timeMemory
742570keisuke6Game (APIO22_game)C++17
12 / 100
96 ms152436 KiB
#include "game.h" #include <iostream> #include <vector> #include <set> #include <queue> using namespace std; vector<vector<vector<int>>> G(101,vector<vector<int>>(30010)); vector<vector<bool>> P(1001,vector<bool>(30010,false)); int N,K; void init(int n, int k) { N = n; K = k; for(int i=0;i<k;i++)for(int j=i;j<k;j++) P[i][j] = true; } int add_teleporter(int u, int v) { for(int i=0;i<K;i++){ G[i][u].push_back(v); if(!P[i][u]){ continue; } queue<int> q; q.push(u); while(!q.empty()){ int pos = q.front(); q.pop(); for(int x:G[i][pos]){ if(P[i][x]){ if(x <= i) return 1; continue; } P[i][x] = true; q.push(x); } G[i][pos].clear(); } } 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...