Submission #556611

#TimeUsernameProblemLanguageResultExecution timeMemory
556611hibikiExhibition (JOI19_ho_t2)C++11
100 / 100
65 ms4892 KiB
#include<bits/stdc++.h> using namespace std; #define PB push_back #define F first #define S second int n,m; vector<int> frame; vector<pair<int,int> > pic; int main() { scanf("%d %d",&n,&m); for(int i=0;i<n;i++) { int a,b; scanf("%d %d",&a,&b); pic.PB({b,a}); } for(int i=0;i<m;i++) { int a; scanf("%d",&a); frame.PB(a); } sort(pic.begin(),pic.end()); sort(frame.begin(),frame.end()); int use=0,frame_i=m-1; for(int i=n-1;i>=0;i--) { if(frame_i<0)break; if(pic[i].S<=frame[frame_i]) { use++; frame_i--; } } printf("%d\n",use); }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d %d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |         scanf("%d %d",&a,&b);
      |         ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%d",&a);
      |         ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...