Submission #540383

#TimeUsernameProblemLanguageResultExecution timeMemory
540383krit3379Exhibition (JOI19_ho_t2)C++17
100 / 100
73 ms4456 KiB
#include<bits/stdc++.h> using namespace std; #define N 200005 int c[N],ans; pair<int,int> a[N]; int main(){ int n,m,i,j; scanf("%d %d",&n,&m); for(i=1;i<=n;i++)scanf("%d %d",&a[i].second,&a[i].first); for(i=1;i<=m;i++)scanf("%d",&c[i]); sort(a+1,a+n+1,greater<pair<int,int>>()); sort(c+1,c+m+1,greater<int>()); for(i=1,j=1;i<=m;i++){ while(j<=n){ if(a[j].second<=c[i])break; else j++; } if(j<=n)j++,ans++; } printf("%d",ans); return 0; }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d %d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:11:27: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     for(i=1;i<=n;i++)scanf("%d %d",&a[i].second,&a[i].first);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:12:27: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for(i=1;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...