Submission #949407

# Submission time Handle Problem Language Result Execution time Memory
949407 2024-03-19T08:09:30 Z Alfraganus Game (APIO22_game) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
// #include "game.h"
#include "grader.cpp"
using namespace std;

const int N = 1001;
int mx[N], K;
vector<int> graph[N];

void init(int n, int k) {
  for(int i = 0; i < n; i ++)
    mx[i] = -1;
  for(int i = 0; i < k; i ++)
    mx[i] = i;
  K = k;
}

int add_teleporter(int u, int v) {
  if(u == v)
    return u < K;
  graph[u].push_back(v);
  queue<int> q;
  if(mx[v] < mx[u])
    q.push(v), mx[v] = mx[u];
  while(!q.empty()){
    int x = q.front();
    q.pop();
    if(x < K)
      if(mx[x] > x)
        return 1;
    for(int i = 0; i < graph[x].size(); i ++)
      if(mx[graph[x][i]] < mx[x])
        mx[graph[x][i]] = mx[x], q.push(graph[x][i]);
  }
  return 0;
}

Compilation message

game.cpp:3:10: fatal error: grader.cpp: No such file or directory
    3 | #include "grader.cpp"
      |          ^~~~~~~~~~~~
compilation terminated.