# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
572071 |
2022-06-03T13:34:31 Z |
1ne |
Exhibition (JOI19_ho_t2) |
C++14 |
|
1000 ms |
468 KB |
#include<bits/stdc++.h>
using namespace std;
const long long mxn = 1e12;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
long long n,m;cin>>n>>m;
vector<pair<long long ,long long>>arr(n);
for (int i = 0;i<n;++i){
cin>>arr[i].second>>arr[i].first;
}
vector<long long >brr(m);
for (int i = 0;i<m;++i)cin>>brr[i];
sort(brr.begin(),brr.end());
sort(arr.begin(),arr.end());
function<long long(int,int)> solve = [&](int cur,int pos){
if (cur==n)return 0LL;
if (pos==m)return 0LL;
long long ans = solve(cur + 1,pos);
if (pos + 1 < m)
ans = max(ans,solve(cur,pos + 1));
if (pos < m && brr[pos]>=arr[cur].second){
ans = max(ans,solve(cur + 1,pos + 1) + 1);
}
return ans;
};
long long ans = solve(0,0);
cout<<ans<<'\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
32 ms |
296 KB |
Output is correct |
3 |
Correct |
44 ms |
296 KB |
Output is correct |
4 |
Correct |
4 ms |
212 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
61 ms |
304 KB |
Output is correct |
7 |
Correct |
17 ms |
212 KB |
Output is correct |
8 |
Correct |
49 ms |
300 KB |
Output is correct |
9 |
Correct |
2 ms |
212 KB |
Output is correct |
10 |
Correct |
6 ms |
316 KB |
Output is correct |
11 |
Correct |
66 ms |
292 KB |
Output is correct |
12 |
Correct |
7 ms |
316 KB |
Output is correct |
13 |
Correct |
16 ms |
320 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 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 |
11 ms |
212 KB |
Output is correct |
19 |
Correct |
4 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
32 ms |
296 KB |
Output is correct |
3 |
Correct |
44 ms |
296 KB |
Output is correct |
4 |
Correct |
4 ms |
212 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
61 ms |
304 KB |
Output is correct |
7 |
Correct |
17 ms |
212 KB |
Output is correct |
8 |
Correct |
49 ms |
300 KB |
Output is correct |
9 |
Correct |
2 ms |
212 KB |
Output is correct |
10 |
Correct |
6 ms |
316 KB |
Output is correct |
11 |
Correct |
66 ms |
292 KB |
Output is correct |
12 |
Correct |
7 ms |
316 KB |
Output is correct |
13 |
Correct |
16 ms |
320 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 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 |
11 ms |
212 KB |
Output is correct |
19 |
Correct |
4 ms |
212 KB |
Output is correct |
20 |
Execution timed out |
1089 ms |
468 KB |
Time limit exceeded |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
32 ms |
296 KB |
Output is correct |
3 |
Correct |
44 ms |
296 KB |
Output is correct |
4 |
Correct |
4 ms |
212 KB |
Output is correct |
5 |
Correct |
3 ms |
212 KB |
Output is correct |
6 |
Correct |
61 ms |
304 KB |
Output is correct |
7 |
Correct |
17 ms |
212 KB |
Output is correct |
8 |
Correct |
49 ms |
300 KB |
Output is correct |
9 |
Correct |
2 ms |
212 KB |
Output is correct |
10 |
Correct |
6 ms |
316 KB |
Output is correct |
11 |
Correct |
66 ms |
292 KB |
Output is correct |
12 |
Correct |
7 ms |
316 KB |
Output is correct |
13 |
Correct |
16 ms |
320 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
0 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 |
11 ms |
212 KB |
Output is correct |
19 |
Correct |
4 ms |
212 KB |
Output is correct |
20 |
Execution timed out |
1089 ms |
468 KB |
Time limit exceeded |
21 |
Halted |
0 ms |
0 KB |
- |