#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <memory.h>
#include <cmath>
#include <array>
using namespace std;
void re(int& x);
template<class T, class... Ts> void re(T& t, Ts&... ts);
void pr(int x);
void pr(const char *x);
void ps();
template<class T, class... Ts> void ps(const T& t, const Ts&... ts);
#ifdef FFDBG
#else
#define dbg(x...) dsfdsfsdfasd
#endif
void re(int& x) { scanf("%d", &x); }
template<class T, class... Ts> void re(T& t, Ts&... ts) {
re(t); re(ts...);
}
void pr(int x) { printf("%d", x); }
void pr(const char *x) { printf("%s", x); }
void ps() { pr("\n"); }
template<class T, class... Ts> void ps(const T& t, const Ts&... ts) {
pr(t); if (sizeof...(ts)) pr(" "); ps(ts...);
}
typedef pair<int, int> pii;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
int n,m;
pii pictures[110000];
int frames[110000];
void solve()
{
re(n,m);
rep(i,0,n) re(pictures[i].second, pictures[i].first);
rep(i,0,m) re(frames[i]);
sort(pictures,pictures+n,greater<pii>());
sort(frames,frames+m,greater<int>());
int curf = 0;
rep(i,0,n) if (curf < m && pictures[i].second <= frames[curf]) curf++;
ps(curf);
}
int main() {
solve();
}
Compilation message
joi2019_ho_t2.cpp: In function 'void re(int&)':
joi2019_ho_t2.cpp:32:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
void re(int& x) { scanf("%d", &x); }
~~~~~^~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
376 KB |
Output is correct |
5 |
Correct |
5 ms |
376 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
4 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
376 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
5 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Correct |
5 ms |
256 KB |
Output is correct |
13 |
Correct |
4 ms |
256 KB |
Output is correct |
14 |
Correct |
5 ms |
256 KB |
Output is correct |
15 |
Correct |
4 ms |
256 KB |
Output is correct |
16 |
Correct |
5 ms |
380 KB |
Output is correct |
17 |
Correct |
5 ms |
256 KB |
Output is correct |
18 |
Correct |
5 ms |
376 KB |
Output is correct |
19 |
Correct |
5 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
376 KB |
Output is correct |
5 |
Correct |
5 ms |
376 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
4 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
376 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
5 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Correct |
5 ms |
256 KB |
Output is correct |
13 |
Correct |
4 ms |
256 KB |
Output is correct |
14 |
Correct |
5 ms |
256 KB |
Output is correct |
15 |
Correct |
4 ms |
256 KB |
Output is correct |
16 |
Correct |
5 ms |
380 KB |
Output is correct |
17 |
Correct |
5 ms |
256 KB |
Output is correct |
18 |
Correct |
5 ms |
376 KB |
Output is correct |
19 |
Correct |
5 ms |
256 KB |
Output is correct |
20 |
Correct |
6 ms |
376 KB |
Output is correct |
21 |
Correct |
5 ms |
376 KB |
Output is correct |
22 |
Correct |
5 ms |
376 KB |
Output is correct |
23 |
Correct |
5 ms |
376 KB |
Output is correct |
24 |
Correct |
5 ms |
376 KB |
Output is correct |
25 |
Correct |
5 ms |
376 KB |
Output is correct |
26 |
Correct |
6 ms |
376 KB |
Output is correct |
27 |
Correct |
5 ms |
376 KB |
Output is correct |
28 |
Correct |
5 ms |
376 KB |
Output is correct |
29 |
Correct |
5 ms |
380 KB |
Output is correct |
30 |
Correct |
5 ms |
376 KB |
Output is correct |
31 |
Correct |
5 ms |
376 KB |
Output is correct |
32 |
Correct |
5 ms |
376 KB |
Output is correct |
33 |
Correct |
5 ms |
256 KB |
Output is correct |
34 |
Correct |
5 ms |
376 KB |
Output is correct |
35 |
Correct |
5 ms |
256 KB |
Output is correct |
36 |
Correct |
5 ms |
376 KB |
Output is correct |
37 |
Correct |
6 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
376 KB |
Output is correct |
5 |
Correct |
5 ms |
376 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
4 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
376 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
5 ms |
256 KB |
Output is correct |
11 |
Correct |
5 ms |
256 KB |
Output is correct |
12 |
Correct |
5 ms |
256 KB |
Output is correct |
13 |
Correct |
4 ms |
256 KB |
Output is correct |
14 |
Correct |
5 ms |
256 KB |
Output is correct |
15 |
Correct |
4 ms |
256 KB |
Output is correct |
16 |
Correct |
5 ms |
380 KB |
Output is correct |
17 |
Correct |
5 ms |
256 KB |
Output is correct |
18 |
Correct |
5 ms |
376 KB |
Output is correct |
19 |
Correct |
5 ms |
256 KB |
Output is correct |
20 |
Correct |
6 ms |
376 KB |
Output is correct |
21 |
Correct |
5 ms |
376 KB |
Output is correct |
22 |
Correct |
5 ms |
376 KB |
Output is correct |
23 |
Correct |
5 ms |
376 KB |
Output is correct |
24 |
Correct |
5 ms |
376 KB |
Output is correct |
25 |
Correct |
5 ms |
376 KB |
Output is correct |
26 |
Correct |
6 ms |
376 KB |
Output is correct |
27 |
Correct |
5 ms |
376 KB |
Output is correct |
28 |
Correct |
5 ms |
376 KB |
Output is correct |
29 |
Correct |
5 ms |
380 KB |
Output is correct |
30 |
Correct |
5 ms |
376 KB |
Output is correct |
31 |
Correct |
5 ms |
376 KB |
Output is correct |
32 |
Correct |
5 ms |
376 KB |
Output is correct |
33 |
Correct |
5 ms |
256 KB |
Output is correct |
34 |
Correct |
5 ms |
376 KB |
Output is correct |
35 |
Correct |
5 ms |
256 KB |
Output is correct |
36 |
Correct |
5 ms |
376 KB |
Output is correct |
37 |
Correct |
6 ms |
376 KB |
Output is correct |
38 |
Correct |
83 ms |
4344 KB |
Output is correct |
39 |
Correct |
85 ms |
4344 KB |
Output is correct |
40 |
Correct |
75 ms |
4344 KB |
Output is correct |
41 |
Correct |
90 ms |
4344 KB |
Output is correct |
42 |
Correct |
83 ms |
4344 KB |
Output is correct |
43 |
Correct |
82 ms |
4344 KB |
Output is correct |
44 |
Correct |
88 ms |
4344 KB |
Output is correct |
45 |
Correct |
87 ms |
4344 KB |
Output is correct |
46 |
Correct |
81 ms |
4344 KB |
Output is correct |
47 |
Correct |
73 ms |
3960 KB |
Output is correct |
48 |
Correct |
77 ms |
3960 KB |
Output is correct |
49 |
Correct |
68 ms |
3576 KB |
Output is correct |
50 |
Correct |
67 ms |
3576 KB |
Output is correct |
51 |
Correct |
83 ms |
4344 KB |
Output is correct |
52 |
Correct |
87 ms |
4344 KB |
Output is correct |
53 |
Correct |
84 ms |
4344 KB |
Output is correct |
54 |
Correct |
68 ms |
4344 KB |
Output is correct |
55 |
Correct |
82 ms |
4552 KB |
Output is correct |
56 |
Correct |
60 ms |
3064 KB |
Output is correct |
57 |
Correct |
33 ms |
1656 KB |
Output is correct |
58 |
Correct |
53 ms |
3064 KB |
Output is correct |
59 |
Correct |
59 ms |
3064 KB |
Output is correct |
60 |
Correct |
34 ms |
1660 KB |
Output is correct |
61 |
Correct |
51 ms |
2552 KB |
Output is correct |
62 |
Correct |
83 ms |
4344 KB |
Output is correct |
63 |
Correct |
88 ms |
4344 KB |
Output is correct |
64 |
Correct |
82 ms |
4344 KB |
Output is correct |
65 |
Correct |
84 ms |
4472 KB |
Output is correct |
66 |
Correct |
83 ms |
4324 KB |
Output is correct |
67 |
Correct |
81 ms |
4344 KB |
Output is correct |
68 |
Correct |
83 ms |
4344 KB |
Output is correct |
69 |
Correct |
83 ms |
4344 KB |
Output is correct |
70 |
Correct |
88 ms |
4472 KB |
Output is correct |
71 |
Correct |
84 ms |
4344 KB |
Output is correct |
72 |
Correct |
83 ms |
4472 KB |
Output is correct |
73 |
Correct |
80 ms |
4320 KB |
Output is correct |