Submission #768978

#TimeUsernameProblemLanguageResultExecution timeMemory
768978t6twotwoComparing Plants (IOI20_plants)C++17
Compilation error
0 ms0 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; using ll = long long; int N, K; vector<int> R, pfs; void init(int k, std::vector<int> r) { K = k, R = r; N = H.size(); pfs.resize(N + 1); for (int i = 0; i < N; i++) { pfs[i + 1] = pfs[i] + R[i]; } } int compare_plants(int x, int y) { if (pfs[y] - pfs[x] == 0) { return 1; } if (pfs[y] - pfs[x] == y - x) { return -1; } if (pfs[N] - pfs[y] + pfs[x] == 0) { return -1; } if (pfs[N] - pfs[y] + pfs[x] == N - y + x) { return 1; } return 0; }

Compilation message (stderr)

plants.cpp: In function 'void init(int, std::vector<int>)':
plants.cpp:8:20: error: 'H' was not declared in this scope
    8 |  K = k, R = r; N = H.size();
      |                    ^