제출 #1305810

#제출 시각아이디문제언어결과실행 시간메모리
1305810jojeonghoon게임 (APIO22_game)C++20
컴파일 에러
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);
}

컴파일 시 표준 에러 (stderr) 메시지

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