Submission #742746

# Submission time Handle Problem Language Result Execution time Memory
742746 2023-05-16T20:28:45 Z keisuke6 Game (APIO22_game) C++17
Compilation error
0 ms 0 KB
#include "game.h"
#include <iostream>
#include <vector>
#include <set>
#include <queue>
using namespace std;
 
map<int,map<int,vector<int>>> G(1001,map<int,vector<int>>(5010));
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].emplace_back(v);
    if(!P[i][u]){
      continue;
    }
    deque<int> q;
    q.push_back(u);
    while(!q.empty()){
      int pos = q.front();
      q.pop_front();
      for(int x:G[i][pos]){
        if(P[i][x]){
          if(x <= i) return 1;
          continue;
        }
        P[i][x] = true;
        q.push_back(x);
      }
      G[i][pos].clear();
    }
  }
  return 0;
}

Compilation message

game.cpp:8:1: error: 'map' does not name a type
    8 | map<int,map<int,vector<int>>> G(1001,map<int,vector<int>>(5010));
      | ^~~
game.cpp: In function 'int add_teleporter(int, int)':
game.cpp:18:5: error: 'G' was not declared in this scope
   18 |     G[i][u].emplace_back(v);
      |     ^