#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define db double
using namespace std;
int n,m;
pair<int,int> a[100001];
int b[100001];
int main(){
cin>>n>>m;
for(int k=1;k<=n;k++){
cin>>a[k].ss>>a[k].ff;
}
sort(a+1,a+n+1);
for(int k=1;k<=m;k++){
cin>>b[k];
}
sort(b+1,b+m+1);
int bolo=m;
int cnt=0;
for(int k=n;k>=1;k--){
if(a[k].ss<=b[bolo]){
cnt++;
bolo--;
}
}
cout<<cnt;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
240 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
240 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
2 ms |
212 KB |
Output is correct |
21 |
Correct |
2 ms |
212 KB |
Output is correct |
22 |
Correct |
2 ms |
212 KB |
Output is correct |
23 |
Correct |
2 ms |
212 KB |
Output is correct |
24 |
Correct |
2 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
316 KB |
Output is correct |
26 |
Correct |
2 ms |
212 KB |
Output is correct |
27 |
Correct |
2 ms |
212 KB |
Output is correct |
28 |
Correct |
2 ms |
212 KB |
Output is correct |
29 |
Correct |
2 ms |
212 KB |
Output is correct |
30 |
Correct |
2 ms |
212 KB |
Output is correct |
31 |
Correct |
2 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
212 KB |
Output is correct |
36 |
Correct |
2 ms |
212 KB |
Output is correct |
37 |
Correct |
2 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
240 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
0 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
212 KB |
Output is correct |
18 |
Correct |
0 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
2 ms |
212 KB |
Output is correct |
21 |
Correct |
2 ms |
212 KB |
Output is correct |
22 |
Correct |
2 ms |
212 KB |
Output is correct |
23 |
Correct |
2 ms |
212 KB |
Output is correct |
24 |
Correct |
2 ms |
212 KB |
Output is correct |
25 |
Correct |
2 ms |
316 KB |
Output is correct |
26 |
Correct |
2 ms |
212 KB |
Output is correct |
27 |
Correct |
2 ms |
212 KB |
Output is correct |
28 |
Correct |
2 ms |
212 KB |
Output is correct |
29 |
Correct |
2 ms |
212 KB |
Output is correct |
30 |
Correct |
2 ms |
212 KB |
Output is correct |
31 |
Correct |
2 ms |
212 KB |
Output is correct |
32 |
Correct |
1 ms |
212 KB |
Output is correct |
33 |
Correct |
1 ms |
212 KB |
Output is correct |
34 |
Correct |
1 ms |
212 KB |
Output is correct |
35 |
Correct |
1 ms |
212 KB |
Output is correct |
36 |
Correct |
2 ms |
212 KB |
Output is correct |
37 |
Correct |
2 ms |
212 KB |
Output is correct |
38 |
Correct |
128 ms |
1452 KB |
Output is correct |
39 |
Correct |
122 ms |
1408 KB |
Output is correct |
40 |
Correct |
132 ms |
1388 KB |
Output is correct |
41 |
Correct |
128 ms |
1448 KB |
Output is correct |
42 |
Correct |
122 ms |
1444 KB |
Output is correct |
43 |
Correct |
133 ms |
1392 KB |
Output is correct |
44 |
Correct |
131 ms |
1416 KB |
Output is correct |
45 |
Correct |
125 ms |
1456 KB |
Output is correct |
46 |
Correct |
126 ms |
1444 KB |
Output is correct |
47 |
Correct |
135 ms |
1272 KB |
Output is correct |
48 |
Correct |
109 ms |
1340 KB |
Output is correct |
49 |
Correct |
95 ms |
1200 KB |
Output is correct |
50 |
Correct |
93 ms |
1116 KB |
Output is correct |
51 |
Correct |
134 ms |
1416 KB |
Output is correct |
52 |
Correct |
138 ms |
1520 KB |
Output is correct |
53 |
Correct |
118 ms |
1384 KB |
Output is correct |
54 |
Correct |
113 ms |
1424 KB |
Output is correct |
55 |
Correct |
124 ms |
1356 KB |
Output is correct |
56 |
Correct |
91 ms |
1168 KB |
Output is correct |
57 |
Correct |
42 ms |
592 KB |
Output is correct |
58 |
Correct |
75 ms |
992 KB |
Output is correct |
59 |
Correct |
80 ms |
972 KB |
Output is correct |
60 |
Correct |
44 ms |
596 KB |
Output is correct |
61 |
Correct |
68 ms |
844 KB |
Output is correct |
62 |
Correct |
129 ms |
1392 KB |
Output is correct |
63 |
Correct |
125 ms |
1448 KB |
Output is correct |
64 |
Correct |
119 ms |
1344 KB |
Output is correct |
65 |
Correct |
117 ms |
1352 KB |
Output is correct |
66 |
Correct |
155 ms |
1352 KB |
Output is correct |
67 |
Correct |
128 ms |
1340 KB |
Output is correct |
68 |
Correct |
125 ms |
1580 KB |
Output is correct |
69 |
Correct |
120 ms |
1356 KB |
Output is correct |
70 |
Correct |
131 ms |
1376 KB |
Output is correct |
71 |
Correct |
117 ms |
1452 KB |
Output is correct |
72 |
Correct |
125 ms |
1352 KB |
Output is correct |
73 |
Correct |
130 ms |
1428 KB |
Output is correct |