제출 #1170548

#제출 시각아이디문제언어결과실행 시간메모리
1170548raymedBouquet (EGOI24_bouquet)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> 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(I[j].first, I[i].second) > i) { dp[i]= max(1, max(dp[i], dp[j] + 1)); } } } }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
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:7:54: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
    7 |                 for (int i = 0; i < n; ++i) cin >> I.first >> I.second;
      |                                                      ^~~~~
Main.cpp:7:65: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
    7 |                 for (int i = 0; i < n; ++i) cin >> I.first >> I.second;
      |                                                                 ^~~~~~
Main.cpp:11:17: error: 'dp' was not declared in this scope; did you mean 'dup'?
   11 |                 dp[i]= max(1, max(dp[i], dp[j] + 1));
      |                 ^~
      |                 dup