Submission #1170543

#TimeUsernameProblemLanguageResultExecution timeMemory
1170543raymedBouquet (EGOI24_bouquet)C++20
Compilation error
0 ms0 KiB
#include <iostream> using namespace std; int main() { int N; cin >> N; vector<pair<int,int>> I(N); for (int i = 0; i < n; ++i) cin >> I.first >> I.second; for (int i = 0; i < N; ++i) { for (int j = N-1; j >= i-5; --j) { if (j - max(flowers[j].first, flowers[i].second) > i) { dp[i]= max(1, max(dp[i], dp[j] + 1)); } } } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:6:17: error: 'vector' was not declared in this scope
    6 |                 vector<pair<int,int>> I(N);
      |                 ^~~~~~
Main.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
Main.cpp:6:36: error: expected primary-expression before '>' token
    6 |                 vector<pair<int,int>> I(N);
      |                                    ^~
Main.cpp:6:39: error: 'I' was not declared in this scope
    6 |                 vector<pair<int,int>> I(N);
      |                                       ^
Main.cpp:7:37: error: 'n' was not declared in this scope
    7 |                 for (int i = 0; i < n; ++i) cin >> I.first >> I.second;
      |                                     ^
Main.cpp:10:25: error: 'flowers' was not declared in this scope
   10 |             if (j - max(flowers[j].first, flowers[i].second) > i) {
      |                         ^~~~~~~
Main.cpp:11:17: error: 'dp' was not declared in this scope
   11 |                 dp[i]= max(1, max(dp[i], dp[j] + 1));
      |                 ^~