Submission #235929

#TimeUsernameProblemLanguageResultExecution timeMemory
235929NightlightExhibition (JOI19_ho_t2)C++14
100 / 100
94 ms4536 KiB
#include <bits/stdc++.h>
#define pii pair<int, int>
using namespace std;

int N, M;
int F[100005];
pii P[100005];

int main() {
  scanf("%d %d", &N, &M);
  for(int i = 1; i <= N; i++) {
    scanf("%d %d", &P[i].second, &P[i].first);
  }
  for(int i = 1; i <= M; i++) {
    scanf("%d", &F[i]);
  }
  sort(F + 1, F + M + 1);
  sort(P + 1, P + N + 1);
  int ans = 0;
  for(int i = N; i > 0; i--) {
    int pos = lower_bound(F + 1, F + M + 1, P[i].second) - F;
    if(M - pos >= ans)ans++;
  }
  printf("%d\n", ans);
}

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:10: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:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &P[i].second, &P[i].first);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &F[i]);
     ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...