이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pii pair<long long int,long long int>
#define vi vector<long long int >
#define vvi vector<vector< long long int>>
#define MP make_pair
#define PB push_back
#define pb pop_back
#define PF push_front
#define pf pop_front
#define MOD 1000000007
#define MT make_tuple
ll n,m;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>m;
pii a[n];
ll b[m];
for(ll i=0;i<n;i++)
{
cin>>a[i].second>>a[i].first;
}
for(ll i=0;i<m;i++)
cin>>b[i];
sort(a,a+n);
sort(b,b+m);
ll j=n-1;
ll ans=0;
for(ll i=m-1;i>=0 && j>=0;i--)
{
while(j>=0 && a[j].second>b[i])
j--;
if(j>=0)
{
ans++;
j--;
}
}
cout<<ans<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |