제출 #385897

#제출 시각아이디문제언어결과실행 시간메모리
385897victoriad게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h"
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <stack>
#include <fstream>
using namespace std;
vector<int>g;
int a,b,x;
void initialize(int n) {
a=-1;
b=-1;
g.assign(n,n-1);
x=(n*(n-1))/2;

}
 
int hasEdge(int u, int v) {
        x--;
        if(g[u]>2 && g[v]>2){
        g[u]--;
        g[v]--;
        return 0;
    }
    else if(a!=-1 && b!=-1){
        return 1;
    }
    else if(g[u]==2 && g[v]==2){
            return 1;
    }
    else{
        if(a==-1 && b==-1){
           a=u;
            g[u]--;
            g[v]--;
            return 0; 
        }
        else{
            return 1;
        }
    }

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

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:47:5: error: expected '}' at end of input
   47 |     }
      |     ^
game.cpp:24:27: note: to match this '{'
   24 | int hasEdge(int u, int v) {
      |                           ^