이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define MAXN 100010
using namespace std;
ll c[MAXN];
vector<pair<ll,ll> > p;
bool Cmp(pair<ll,ll> a,pair<ll,ll> b)
{
if (a.first!=b.first)
return a.first>b.first;
return a.second>b.second;
}
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll n,m,s,v;
cin >> n >> m;
for (ll i=1;i<=n;i++)
{
cin >> s >> v;
p.push_back({v,s});
}
sort(p.begin(),p.end());
for (ll i=1;i<=m;i++)
cin >> c[i];
sort(c+1,c+1+m);
ll pos=n-1,ans=0;
for (ll i=m;i>=1;i--)
{
while (pos>=0 && p[pos].second>c[i])
pos--;
if (pos>=0)
{
ans++;
pos--;
}
}
cout << ans;
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... |