# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023843 | vjudge1 | Exhibition (JOI19_ho_t2) | C++17 | 44 ms | 4688 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.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define task "code"
const int ar=1e5+5;
const ll mod=1e9+7;
int n,m;
pair<int,int> pic[ar];
int c[ar];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
if (fopen(task".inp","r"))
{
freopen(task".inp","r",stdin);
freopen(task".out","w",stdout);
}
cin>>n>>m;
for (int i=1;i<=n;i++)
{
cin>>pic[i].se>>pic[i].fi;
}
for (int i=1;i<=m;i++)
{
cin>>c[i];
}
sort(c+1,c+m+1);
sort(pic+1,pic+n+1);
int ans=0;
int pos=m;
for (int i=n;i>=1;i--)
{
int s=pic[i].se;
if (c[pos]>=s) ans++,pos--;
if (ans==m) return cout<<m,0;
}
cout<<ans;
}
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... |