Submission #133159

#TimeUsernameProblemLanguageResultExecution timeMemory
133159shenxyExhibition (JOI19_ho_t2)C++11
100 / 100
91 ms4472 KiB
#include <cstdio>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int, int> ii;
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  ii paint[N];
  int frame[M];
  for (int i = 0; i < N; i++) scanf("%d %d", &paint[i].second, &paint[i].first);
  for (int i = 0; i < M; i++) scanf("%d", &frame[i]);
  sort(paint, paint + N);
  sort(frame, frame + M);
  int num = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (M - (lower_bound(frame, frame + M, paint[i].second) - frame) > num) num++;
  }
  printf("%d", num);
  return 0;
}

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &N, &M);
   ~~~~~^~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:11:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (int i = 0; i < N; i++) scanf("%d %d", &paint[i].second, &paint[i].first);
                               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:12:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (int i = 0; i < M; i++) scanf("%d", &frame[i]);
                               ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...