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;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
#define all(x) x.begin(), x.end()
#define rep(i,a,b) for(int i = a; i < b; i++)
int main() {
int N, M;
cin >> N;
cin >> M;
vpii P(N);
rep(n,0,N) {
int s, v;
cin >> s;
cin >> v;
P[n] = make_pair(v, s);
}
sort(all(P), greater<>());
vi F(M);
rep(m,0,M) cin >> F[m];
sort(all(F), greater<>());
int num = 0;
int m = 0;
for(int n = 0; n < N && m < M; n++) {
if(P[n].second <= F[m]) {
num++;
m++;
}
}
cout << m << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |