Submission #99090

#TimeUsernameProblemLanguageResultExecution timeMemory
99090gs14004Exhibition (JOI19_ho_t2)C++17
100 / 100
99 ms1572 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 300005; using lint = long long; using pi = pair<int, int>; int n, m, c[MAXN]; pi a[MAXN]; int main(){ scanf("%d %d",&n,&m); for(int i=1; i<=n; i++) scanf("%d %d",&a[i].second,&a[i].first); sort(a + 1, a + n + 1); for(int i=1; i<=m; i++) scanf("%d",&c[i]); sort(c + 1, c + m + 1); int dap = 0; int ptr = n; for(int i=m; i; i--){ while(ptr > 0 && a[ptr].second > c[i]) ptr--; if(ptr > 0){ ptr--; dap++; } } cout << dap << endl; }

Compilation message (stderr)

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