제출 #736653

#제출 시각아이디문제언어결과실행 시간메모리
736653JellyTheOctopusExhibition (JOI19_ho_t2)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define f first #define s second int N, M; vector<pair<int, int>> pictures; vector<int> frames; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> M; pictures.resize(N); frames.resize(M); for (int i = 0; i < N; i++) { cin >> pictures[i].s >> pictures[i].f; } for (int i = 0; i < M; i++) { cin >> frames[i]; } sort(pictures.begin(), pictures.end()); sort(frames.begin(), frames.end()); int finalAns = 0; for (int i = 0; i < N; i++) { if ((i == N-1) || (pictures[i].s > pictures[i+1].s)) { int j = i; int k = M-1; int localAns = 0; while ((j >= 0) && (k >= 0)) { bool flag = false; while (pictures[j].s > frames[k]) { j--; if (j < 0) { flag = true; break; } } if (flag) break; localAns++; j--; k--; } finalAns = max(localAns, finalAns); } } cout << finalAns << "\n";

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:48:26: error: expected '}' at end of input
   48 |  cout << finalAns << "\n";
      |                          ^
joi2019_ho_t2.cpp:11:12: note: to match this '{'
   11 | int main() {
      |            ^