Submission #900620

#TimeUsernameProblemLanguageResultExecution timeMemory
900620jay_jayjayExhibition (JOI19_ho_t2)C++17
100 / 100
52 ms4780 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(),x.end() int main() { int n, m;scanf("%d%d",&n,&m); vector<array<int,2>> pic(n); for(auto&[x,y]:pic)scanf("%d%d",&y,&x); vector<int> fr(m); for(auto&x:fr)scanf("%d",&x); sort(all(fr)); sort(all(pic)); int i=m-1, j=n-1; int cnt=0; while(i>=0&&j>=0) { while(j>=0 && pic[j][1] > fr[i]) j--; if(j<0) break; cnt++;j--;i--; } printf("%d\n",cnt); }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:7:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |         int n, m;scanf("%d%d",&n,&m);
      |                  ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t2.cpp:10:33: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         for(auto&[x,y]:pic)scanf("%d%d",&y,&x);
      |                            ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t2.cpp:12:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         for(auto&x:fr)scanf("%d",&x);
      |                       ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...