Submission #465059

# Submission time Handle Problem Language Result Execution time Memory
465059 2021-08-15T04:25:10 Z jamezzz Exhibition (JOI19_ho_t2) C++17
100 / 100
70 ms 4876 KB
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#include <ext/rope>
using namespace __gnu_cxx;

typedef tree<long long, null_type, less<long long>,
rb_tree_tag, tree_order_statistics_node_update> pbds;
//less_equal for identical elements

#ifdef DEBUG
#define dbg(...) printf(__VA_ARGS__);
#else
#define dbg(...)
#endif
#define sf scanf
#define pf printf
#define fi first
#define se second
#define pb emplace_back
#define sz(x) (int)x.size()
#define mnto(x,y) x=min(x,(__typeof__(x))y)
#define mxto(x,y) x=max(x,(__typeof__(x))y)
#define INF 1023456789
#define LINF 1023456789123456789
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
typedef tuple<int, int, int, int> iiii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vll;
mt19937 rng(time(0));

int n,m,s,v,c;
vi f;
vii p;

int main(){
	sf("%d%d",&n,&m);
	for(int i=0;i<n;++i){
		sf("%d%d",&s,&v);
		p.pb(v,s);
	}
	for(int i=0;i<m;++i){
		sf("%d",&c);
		f.pb(c);
	}
	sort(all(p));
	sort(all(f));
	while(sz(p)&&sz(f)){
		if(p.back().se<=f.back())f.pop_back();
		p.pop_back();
	}
	pf("%d\n",m-sz(f));
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:45:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |  sf("%d%d",&n,&m);
      |    ^
joi2019_ho_t2.cpp:47:5: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   47 |   sf("%d%d",&s,&v);
      |     ^
joi2019_ho_t2.cpp:51:5: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |   sf("%d",&c);
      |     ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 0 ms 300 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 0 ms 300 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 308 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 1 ms 332 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 1 ms 332 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 2 ms 332 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 1 ms 308 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 332 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 332 KB Output is correct
37 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 0 ms 300 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 308 KB Output is correct
22 Correct 1 ms 332 KB Output is correct
23 Correct 1 ms 332 KB Output is correct
24 Correct 1 ms 332 KB Output is correct
25 Correct 1 ms 332 KB Output is correct
26 Correct 1 ms 332 KB Output is correct
27 Correct 1 ms 332 KB Output is correct
28 Correct 1 ms 332 KB Output is correct
29 Correct 1 ms 332 KB Output is correct
30 Correct 2 ms 332 KB Output is correct
31 Correct 1 ms 332 KB Output is correct
32 Correct 1 ms 308 KB Output is correct
33 Correct 1 ms 204 KB Output is correct
34 Correct 1 ms 332 KB Output is correct
35 Correct 1 ms 204 KB Output is correct
36 Correct 1 ms 332 KB Output is correct
37 Correct 1 ms 332 KB Output is correct
38 Correct 61 ms 4868 KB Output is correct
39 Correct 56 ms 4796 KB Output is correct
40 Correct 55 ms 4788 KB Output is correct
41 Correct 62 ms 4804 KB Output is correct
42 Correct 61 ms 4856 KB Output is correct
43 Correct 60 ms 4804 KB Output is correct
44 Correct 66 ms 4772 KB Output is correct
45 Correct 61 ms 4812 KB Output is correct
46 Correct 70 ms 4728 KB Output is correct
47 Correct 55 ms 4400 KB Output is correct
48 Correct 52 ms 4404 KB Output is correct
49 Correct 49 ms 3956 KB Output is correct
50 Correct 48 ms 3988 KB Output is correct
51 Correct 60 ms 4828 KB Output is correct
52 Correct 60 ms 4776 KB Output is correct
53 Correct 59 ms 4804 KB Output is correct
54 Correct 59 ms 4836 KB Output is correct
55 Correct 63 ms 4812 KB Output is correct
56 Correct 39 ms 3076 KB Output is correct
57 Correct 28 ms 1740 KB Output is correct
58 Correct 37 ms 3040 KB Output is correct
59 Correct 39 ms 3036 KB Output is correct
60 Correct 23 ms 1736 KB Output is correct
61 Correct 38 ms 2756 KB Output is correct
62 Correct 62 ms 4832 KB Output is correct
63 Correct 60 ms 4824 KB Output is correct
64 Correct 61 ms 4752 KB Output is correct
65 Correct 61 ms 4768 KB Output is correct
66 Correct 62 ms 4776 KB Output is correct
67 Correct 62 ms 4764 KB Output is correct
68 Correct 62 ms 4828 KB Output is correct
69 Correct 67 ms 4780 KB Output is correct
70 Correct 61 ms 4828 KB Output is correct
71 Correct 61 ms 4876 KB Output is correct
72 Correct 63 ms 4868 KB Output is correct
73 Correct 59 ms 4788 KB Output is correct