# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
103611 | Alliance | Exhibition (JOI19_ho_t2) | C++14 | 98 ms | 4660 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// In the name of Allah. Ya ali!
#include<bits/stdc++.h>
#define double long double
typedef long long ll;
const ll MAX_N = 1e5+10;
const ll MOD = 1e9+7;
using namespace std;
pair<int,int> lr[MAX_N];
int a[MAX_N];
int n,m;
int main()
{
cin >> n >> m;
for(int i = 1;i<=n;++i)
scanf("%d%d",&lr[i].second,&lr[i].first);
for(int i = 1;i<=m;++i)
scanf("%d",&a[i]);
sort(a+1,a+m+1);
sort(lr+1,lr+n+1);
int ans = 0;
int p = n;
for(int i = m;i>=1 and p>0;--i)
{
while(p and lr[p].second>a[i])
p--;
if (p>0)
ans++;
p--;
}
cout << ans;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |