Submission #924137

#TimeUsernameProblemLanguageResultExecution timeMemory
924137panExhibition (JOI19_ho_t2)C++17
100 / 100
50 ms5840 KiB
#include <bits/stdc++.h> //#include "bits_stdc++.h" #include <stdio.h> #include <algorithm> #include <memory.h> #define f first #define s second #define pb push_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define input(x) scanf("%lld", &x); #define print(x, y) printf("%lld%c", x, y); #define show(x) cerr << #x << " is " << x << endl; #define show2(x,y) cerr << #x << " is " << x << " " << #y << " is " << y << endl; #define show3(x,y,z) cerr << #x << " is " << x << " " << #y << " is " << y << " " << #z << " is " << z << endl; #define discretize(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end()); using namespace std; typedef long long ll; typedef long double ld; typedef pair<ld, ll> pd; typedef pair<string, ll> psl; typedef pair<ll, ll> pi; typedef pair<ll, pi> pii; int main() { ll n, m; input(n); input(m); vector<pi> pictures(n); vector<ll> frames(m); for (ll i=0; i<n; ++i) {input(pictures[i].s); input(pictures[i].f);} for (ll i=0; i<m; ++i) {input(frames[i]);} sort(pictures.begin(), pictures.end(), greater<pi>()); sort(frames.begin(), frames.end(), greater<ll>()); ll p = 0; ll i = 0; for (;i<m; ++i) { while (p<n && pictures[p].s>frames[i]) p++; if (p==n) break; p++; } print(i, '\n'); return 0; }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:12:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | #define input(x) scanf("%lld", &x);
      |                  ~~~~~^~~~~~~~~~~~
joi2019_ho_t2.cpp:29:2: note: in expansion of macro 'input'
   29 |  input(n); input(m);
      |  ^~~~~
joi2019_ho_t2.cpp:12:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | #define input(x) scanf("%lld", &x);
      |                  ~~~~~^~~~~~~~~~~~
joi2019_ho_t2.cpp:29:12: note: in expansion of macro 'input'
   29 |  input(n); input(m);
      |            ^~~~~
joi2019_ho_t2.cpp:12:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | #define input(x) scanf("%lld", &x);
      |                  ~~~~~^~~~~~~~~~~~
joi2019_ho_t2.cpp:32:26: note: in expansion of macro 'input'
   32 |  for (ll i=0; i<n; ++i) {input(pictures[i].s); input(pictures[i].f);}
      |                          ^~~~~
joi2019_ho_t2.cpp:12:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | #define input(x) scanf("%lld", &x);
      |                  ~~~~~^~~~~~~~~~~~
joi2019_ho_t2.cpp:32:48: note: in expansion of macro 'input'
   32 |  for (ll i=0; i<n; ++i) {input(pictures[i].s); input(pictures[i].f);}
      |                                                ^~~~~
joi2019_ho_t2.cpp:12:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 | #define input(x) scanf("%lld", &x);
      |                  ~~~~~^~~~~~~~~~~~
joi2019_ho_t2.cpp:33:26: note: in expansion of macro 'input'
   33 |  for (ll i=0; i<m; ++i) {input(frames[i]);}
      |                          ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...