Submission #556609

#TimeUsernameProblemLanguageResultExecution timeMemory
556609hibikiExhibition (JOI19_ho_t2)C++11
0 / 100
1 ms304 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; for(int i=m-1;i>=0;i--) { int pic_i = n - use - 1; if(pic[pic_i].S<=frame[i])use++; } 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...