Submission #702727

#TimeUsernameProblemLanguageResultExecution timeMemory
702727math_rabbit_1028Game (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
int root[1515], dep[1515], can[1515], comp, last;

void initialize(int n) {
    for (int i = 0; i < n; i++) cnt[i] = 0;
}

int hasEdge(int u, int v) {
    if (u > v) swap(u, v);
    cnt[v]++;
    if (cnt[v] == v) return 1;
    else return 0;
}

Compilation message (stderr)

game.cpp: In function 'void initialize(int)':
game.cpp:7:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
    7 |     for (int i = 0; i < n; i++) cnt[i] = 0;
      |                                 ^~~
      |                                 int
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:12:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |     cnt[v]++;
      |     ^~~
      |     int
game.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^