Submission #1218468

#TimeUsernameProblemLanguageResultExecution timeMemory
1218468fr1tzyRabbit Carrot (LMIO19_triusis)C++20
Compilation error
0 ms0 KiB
#include <algorithm> #include <iostream> #include <vector> using namespace std; int longest(const vector<int> &seq) { vector<int> minimum; for (int i : seq) { int pos = std::upper_bound(minimum.begin(), minimm.end(), i) - minimum.begin(); if (pos == minimum.size()) { minimum.push_back(i); } else { minimum[pos] = i; } } return minimum.size(); } int main() { int pole; int height; std::cin >> pole >> height; vector<int> poles(pole); for (int p = 0; p < pole; p++) { std::cin >> poles[p]; } vector<int> nochange; for (int i = 1; i <= pole; i++) { if (i * height >= poles[i - 1]) { nochange.push_back(i * height - poles[i - 1]); } } cout << pole - longest(nochange) << endl; }

Compilation message (stderr)

triusis.cpp: In function 'int longest(const std::vector<int>&)':
triusis.cpp:10:61: error: 'minimm' was not declared in this scope; did you mean 'minimum'?
   10 |                 int pos = std::upper_bound(minimum.begin(), minimm.end(), i) - minimum.begin();
      |                                                             ^~~~~~
      |                                                             minimum