Submission #1097234

#TimeUsernameProblemLanguageResultExecution timeMemory
1097234StefanSebezExhibition (JOI19_ho_t2)C++14
100 / 100
40 ms4688 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define ll long long #define ld long double const int N=1e5+50; pair<int,int>a[N]; int b[N]; int main(){ int n,m;scanf("%i%i",&n,&m); for(int i=1;i<=n;i++) scanf("%i%i",&a[i].fi,&a[i].se); for(int i=1;i<=m;i++) scanf("%i",&b[i]); sort(a+1,a+n+1,[&](pair<int,int>A,pair<int,int>B){return A.se<B.se||(A.se==B.se&&A.fi<B.fi);}); sort(b+1,b+m+1); int res=0; //for(int i=1;i<=n;i++) printf("{%i %i} ",a[i].fi,a[i].se);printf("\n"); for(int i=n,j=m;i>=1&&j>=1;i--){ if(a[i].fi<=b[j]){ res++; j--; } } printf("%i\n",res); return 0; }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:12:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     int n,m;scanf("%i%i",&n,&m);
      |             ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t2.cpp:13:32: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     for(int i=1;i<=n;i++) scanf("%i%i",&a[i].fi,&a[i].se);
      |                           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:14:32: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     for(int i=1;i<=m;i++) scanf("%i",&b[i]);
      |                           ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...