제출 #703682

#제출 시각아이디문제언어결과실행 시간메모리
703682qwe1rt1yuiop1Exhibition (JOI19_ho_t2)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #define int long long using namespace std; typedef pair<int, int> pii; inline void solve() { int n, m; cin >> n >> m; vector<pii> v(n); for (pii &i : v) cin >> i.second >> i.first; vector<int> f(m); for (auto &i : f) cin >> i; sort(v.begin(), v.end()), sort(f.begin(), f.end()); reverse(v.begin(), v.end()), reverse(f.begin(), f.end()); // cout << '\n'; // for (auto i : v) // cout << i.first << ' ' << i.second << '\n'; // for (int i : f) // cout << i << ' '; // cout << '\n'; int mx = 0, cur = 0; for (pii i : v) { while (cur >= m || cur >= 0 && f[cur] < i.second) --cur; mx = max(mx, ++cur); // cerr << cur << ' '; } cout << min(mx, m) << '\n'; } signed main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); solve(); return 0; }

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

joi2019_ho_t2.cpp: In function 'void solve()':
joi2019_ho_t2.cpp:29:37: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   29 |         while (cur >= m || cur >= 0 && f[cur] < i.second)
      |                            ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...