Submission #129392

#TimeUsernameProblemLanguageResultExecution timeMemory
129392hungcungExhibition (JOI19_ho_t2)C++17
100 / 100
76 ms1656 KiB
#include<bits/stdc++.h> using namespace std; int n,m,c[100005],dem,ans; pair<int,int> a[100005]; 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(a,a+n); sort(c,c+m); dem=n-1; for(int i=m-1;i>=0;i--){ while(dem>=0&&a[dem].second>c[i]){ dem--; } if(dem>=0){ ans++; dem--; } } printf("%d",ans); }

Compilation message (stderr)

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