Submission #786240

#TimeUsernameProblemLanguageResultExecution timeMemory
786240KN200711Exhibition (JOI19_ho_t2)C++14
100 / 100
55 ms1600 KiB
# include <bits/stdc++.h> # define fi first # define se second using namespace std; int main() { int N, M; scanf("%d %d", &N, &M); vector< pair<int, int> > S(N); for(int i=0;i<N;i++) { scanf("%d %d", &S[i].se, &S[i].fi); } vector<int> T(M); for(int i=0;i<M;i++) scanf("%d", &T[i]); sort(S.begin(), S.end()); sort(T.begin(), T.end()); int ans = 0, ls = M-1; for(int i=N-1;i>=0;i--) { if(ls >= 0 && S[i].se <= T[ls]) { ans++; ls--; } } printf("%d\n", ans); }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:8:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  scanf("%d %d", &N, &M);
      |  ~~~~~^~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d %d", &S[i].se, &S[i].fi);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:14:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |  for(int i=0;i<M;i++) scanf("%d", &T[i]);
      |                       ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...