Submission #465080

# Submission time Handle Problem Language Result Execution time Memory
465080 2021-08-15T07:27:43 Z MKutayBozkurt Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 204 KB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int32_t main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int n, m; cin >> n >> m;
  vector<pair<int, int>> a(n);
  vector<int> b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i].second >> a[i].first;
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  sort(a.begin(), a.end());
  sort(b.rbegin(), b.rend());
  int i = 0;
  for (auto [x, y] : a) {
    if (i < m && y <= b[i]) i++;
  }
  cout << i << '\n';
}

Compilation message

joi2019_ho_t2.cpp: In function 'int32_t main()':
joi2019_ho_t2.cpp:20:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   20 |   for (auto [x, y] : a) {
      |             ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -