Submission #733680

# Submission time Handle Problem Language Result Execution time Memory
733680 2023-05-01T07:52:18 Z Erkinoff_Mohammed Game (APIO22_game) C++17
0 / 100
0 ms 208 KB
#include "game.h"
 #include "bits/stdc++.h"
 using namespace std;
 #define INF 2000000000
 #define INFLL 3000000000000000000LL
 #define ll long long


 int spec;
 int num;
 vector<vector<int>>adj;
 vector<bool>vis;

 void dfs(int i){
     if(!vis[i]){
         vis[i]=1;
         num--;
     }
     for(int u:adj[i]){
         if(!vis[u]){
             dfs(u);
         }
     }
 }

 void init(int n, int k) {
     adj.resize(n);
     vis.assign(n, 0);
     spec=k;
     num=n-k;
     for(int i=0;i<k;i++)vis[i]=1;
 }

 int add_teleporter(int u, int v) {
     adj[u].push_back(v);
     if(vis[u])dfs(u);
     return num==0;
 }
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -