Submission #1305810

#TimeUsernameProblemLanguageResultExecution timeMemory
1305810jojeonghoonGame (APIO22_game)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "game.h"
using namespace std


const int LM=300100;
int N,K;
vector<int>G[LM];

void init(int N_, int K_){
    N=N_;
    K=K_;
    for(int i=0; i<K-1; i++) G[i].push_back(i+1);
}

int D[LM];
int dfs(int x, int w){
    w+=x<K;
    if(D[x]) return 1;
    D[x]=w;
    for(int i:G[x]){
        if(dfs(i,w)) return 1;
    }
    
    D[x]=0;
    return 0;
}

int add_teleporter(int u, int v){
    G[u].push_back(v);
    return dfs(u,1);
}

Compilation message (stderr)

game.cpp:3:20: error: expected ';' before 'const'
    3 | using namespace std
      |                    ^
      |                    ;
......
    6 | const int LM=300100;
      | ~~~~~