Submission #1145249

#TimeUsernameProblemLanguageResultExecution timeMemory
1145249lucaskojimaGondola (IOI14_gondola)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "gondola.h" #define ff first #define ss second #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define sz(x) (int)(x).size() using namespace std; using ll = long long; using pii = pair<int, int>; const char nl = '\n'; const ll LINF = 0x3f3f3f3f3f3f3f3f; const int INF = 0x3f3f3f3f; int valid(int n, int inputSeq[]) { vector<int> v(n); for (int i = 0; i < n; i++) v[i] = inputSeg[i]; int p = 0; while (p < n && v[p] > n) p++; if (p == n) return 1; int val = v[p]; for (int i = p; i < n; i++) { if (v[i] < n && v[i] != val) return 0; val == n ? val = 1 : val++; } return 1; } int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } int countReplacement(int n, int inputSeq[]) { return -3; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:20:24: error: 'inputSeg' was not declared in this scope; did you mean 'inputSeq'?
   20 |                 v[i] = inputSeg[i];
      |                        ^~~~~~~~
      |                        inputSeq