Submission #97623

#TimeUsernameProblemLanguageResultExecution timeMemory
97623maruiiExhibition (JOI19_ho_t2)C++14
100 / 100
95 ms1668 KiB
#include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; int N, M, C[100000]; pii A[100000]; int main(){ scanf("%d%d",&N,&M); for(int i=0; i<N; ++i) scanf("%d%d",&A[i].second,&A[i].first); for(int i=0; i<M; ++i) scanf("%d",C+i); sort(C, C+M, greater<int>()), sort(A, A+N, greater<pii>()); int ans=0; for(int i=0; i<N && ans<M; ++i) if(C[ans]>=A[i].second) ++ans; printf("%d",ans); return 0; }

Compilation message (stderr)

joi2019_ho_t3.cpp: In function 'int main()':
joi2019_ho_t3.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&N,&M);
  ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t3.cpp:8:30: 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",&A[i].second,&A[i].first);
                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:9:30: 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",C+i);
                         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...