# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
492892 |
2021-12-09T14:46:37 Z |
Biaz |
Exhibition (JOI19_ho_t2) |
C++17 |
|
64 ms |
5672 KB |
#include <bits/stdc++.h>
#define int long long
//#define double long double
#define Nanase_Kurumi_aka_menhera_chan_is_mine ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pi pair<int, int>
#define ALL(i) i.begin(),i.end()
#define gcd(i,j) __gcd(i,j)
#define fi first
#define se second
#define eps 0.00000001
#define ist insert
#define DNE nullptr
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC optimize("O2")
int max(int x,int y){return x>=y?x:y;}
int min(int x,int y){return x>=y?y:x;}
using namespace std;
typedef int ll;
const int N=100005;
const int M=1000005;
const int MOD=1000000007;//998244353;
const int INF=1000000000000000000;//2147483647;
pi a[N];
int c[N],bit[N];
int n,m;
vector<int> LDS;
int get(int v){
int l=0,r=LDS.size()-1,res=-1;
while (r>=l){
int md=(l+r)/2;
if (LDS[md]<=v){
res=md;
r=md-1;
}
else l=md+1;
}
return res;
}
inline void sol(){
cin >>n>>m;
for (int i=1;i<=n;i++)
cin >>a[i].se>>a[i].fi;
for (int j=0;j<m;j++)
cin >>c[j];
sort(a+1,a+n+1,[](pi l,pi r){
return l.fi==r.fi?l.se>r.se:l.fi>r.fi;
});
//for (int i=1;i<=n;i++)
//cout <<a[i].fi<<' '<<a[i].se<<'\n';
sort(c,c+m,greater<int>());
int j=0;
for (int i=1;i<=n;i++)
if (a[i].se<=c[j]){
j++;
}
cout <<j<<'\n';
}
signed main(){
Nanase_Kurumi_aka_menhera_chan_is_mine
int _=1;
//cin >>_;
while (_--) sol();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
0 ms |
332 KB |
Output is correct |
17 |
Correct |
0 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
324 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
0 ms |
332 KB |
Output is correct |
17 |
Correct |
0 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
324 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 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 |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 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 |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
332 KB |
Output is correct |
3 |
Correct |
0 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
0 ms |
332 KB |
Output is correct |
8 |
Correct |
0 ms |
332 KB |
Output is correct |
9 |
Correct |
0 ms |
332 KB |
Output is correct |
10 |
Correct |
0 ms |
332 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
332 KB |
Output is correct |
13 |
Correct |
0 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
332 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
0 ms |
332 KB |
Output is correct |
17 |
Correct |
0 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
324 KB |
Output is correct |
19 |
Correct |
1 ms |
332 KB |
Output is correct |
20 |
Correct |
1 ms |
332 KB |
Output is correct |
21 |
Correct |
1 ms |
332 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 |
1 ms |
332 KB |
Output is correct |
31 |
Correct |
1 ms |
332 KB |
Output is correct |
32 |
Correct |
1 ms |
332 KB |
Output is correct |
33 |
Correct |
1 ms |
332 KB |
Output is correct |
34 |
Correct |
1 ms |
332 KB |
Output is correct |
35 |
Correct |
1 ms |
332 KB |
Output is correct |
36 |
Correct |
1 ms |
332 KB |
Output is correct |
37 |
Correct |
1 ms |
332 KB |
Output is correct |
38 |
Correct |
49 ms |
5548 KB |
Output is correct |
39 |
Correct |
46 ms |
5460 KB |
Output is correct |
40 |
Correct |
42 ms |
5580 KB |
Output is correct |
41 |
Correct |
44 ms |
5444 KB |
Output is correct |
42 |
Correct |
45 ms |
5552 KB |
Output is correct |
43 |
Correct |
49 ms |
5556 KB |
Output is correct |
44 |
Correct |
56 ms |
5564 KB |
Output is correct |
45 |
Correct |
49 ms |
5468 KB |
Output is correct |
46 |
Correct |
64 ms |
5408 KB |
Output is correct |
47 |
Correct |
39 ms |
4976 KB |
Output is correct |
48 |
Correct |
40 ms |
4940 KB |
Output is correct |
49 |
Correct |
37 ms |
4532 KB |
Output is correct |
50 |
Correct |
40 ms |
4512 KB |
Output is correct |
51 |
Correct |
50 ms |
5488 KB |
Output is correct |
52 |
Correct |
52 ms |
5476 KB |
Output is correct |
53 |
Correct |
45 ms |
5444 KB |
Output is correct |
54 |
Correct |
38 ms |
5588 KB |
Output is correct |
55 |
Correct |
42 ms |
5524 KB |
Output is correct |
56 |
Correct |
29 ms |
3764 KB |
Output is correct |
57 |
Correct |
18 ms |
1996 KB |
Output is correct |
58 |
Correct |
29 ms |
3764 KB |
Output is correct |
59 |
Correct |
28 ms |
3788 KB |
Output is correct |
60 |
Correct |
21 ms |
2092 KB |
Output is correct |
61 |
Correct |
26 ms |
3276 KB |
Output is correct |
62 |
Correct |
60 ms |
5488 KB |
Output is correct |
63 |
Correct |
50 ms |
5564 KB |
Output is correct |
64 |
Correct |
47 ms |
5532 KB |
Output is correct |
65 |
Correct |
44 ms |
5488 KB |
Output is correct |
66 |
Correct |
46 ms |
5532 KB |
Output is correct |
67 |
Correct |
44 ms |
5516 KB |
Output is correct |
68 |
Correct |
49 ms |
5672 KB |
Output is correct |
69 |
Correct |
59 ms |
5564 KB |
Output is correct |
70 |
Correct |
47 ms |
5480 KB |
Output is correct |
71 |
Correct |
59 ms |
5500 KB |
Output is correct |
72 |
Correct |
44 ms |
5544 KB |
Output is correct |
73 |
Correct |
42 ms |
5496 KB |
Output is correct |