Submission #306102

# Submission time Handle Problem Language Result Execution time Memory
306102 2020-09-24T14:04:02 Z vipghn2003 Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 384 KB
#include<bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
using namespace std;

const int N=1e5+5;
int n,m,c[N];
pii a[N];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n>>m;
    vector<int>val;
    for(int i=1;i<=n;i++) cin>>a[i].se>>a[i].fi;
    for(int i=1;i<=m;i++) cin>>c[i];
    sort(a+1,a+n+1);
    int cur=n,res=0;
    for(int i=m;i>=1;i--)
    {
        while(cur>=1&&a[cur].se>c[i]) cur--;
        if(cur)
        {
            res++;
            cur--;
        }
    }
    cout<<res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -