Submission #1013506

#TimeUsernameProblemLanguageResultExecution timeMemory
1013506Error404게임 (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define f first
#define s second
#define pi pair<ll,ll>
#define vi vector<ll>
#define vpi vector<pi>
#define pb push_back
#define INF 1e18
#define endl '\n'
//#define int ll
#define pii pair<pi,ll>

const int MAX = 1e5+1;

vpi g[MAX];
ll dis[MAX][2];
int hold[MAX];

void initialize(int n){
    for(int i = 1; i <=n ; i++){
        hold[i] =i-1;
    }
}

int hasEdge(int u,int v){
    if(u <v) swap(u,v);
    if(hold[i]==1) return 1;
    else{
        hold[i]--;
        return 0;
    }

}

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:29:13: error: 'i' was not declared in this scope
   29 |     if(hold[i]==1) return 1;
      |             ^
game.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^