This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
_ ________ ___ __ ___ _ _ _
| | / /| _ \ / _ \ / // _ \ | | | |(_)
| |/ / | | | |/ /_\ \ / // /_\ \| | __ __ _ | | _
| \ | | | || _ | / / | _ || |/ // _` || || |
| |\ \| |/ / | | | | / / | | | || <| (_| || || |
\_| \_/|___/ \_| |_//_/ \_| |_/|_|\_\\__,_||_||_|
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5+50;
const int mod = 1e9+7;
#define size sdkdsf
#define pb push_back
const int in = 1e9+9;
typedef pair<int,int> ii;
int n, m;
struct Exhibition{
int s, v;
} Pictures[N];
int size[N];
#define fi first
#define se second
signed main(){
cin >> n >> m;
for(int i=1;i<=n;i++){
cin >> Pictures[i].s >> Pictures[i].v;
}
for(int i=1;i<=m;i++) cin >> size[i];
sort(Pictures+1,Pictures+n+1,[](Exhibition _a,Exhibition _b){return _a.v > _b.v or (_a.v == _b.v and _a.s > _b.s);});
sort(size+1,size+m+1,greater<int>());
int it = 1;
for(int i=1;i<=n;i++){
if(it<=m and Pictures[i].s <= size[it]) it++;
}
cout << it-1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |