Submission #433475

# Submission time Handle Problem Language Result Execution time Memory
433475 2021-06-19T21:06:35 Z MilosMilutinovic Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 300 KB
#include <bits/stdc++.h>
#define MAXN 100007
using namespace std;
pair<int,int> a[MAXN];
int b[MAXN];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0;i<n;i++) cin>>a[i].second>>a[i].first;
    for(int i=0;i<m;i++) cin>>b[i];
    sort(a,a+n);
    sort(b,b+m);
    int x=n-1,y=m-1,ans=0;
    while(x>=0 && y>=0)
    {
        if(b[y]>=a[x].first)
        {
            y--;
            ans++;
        }
        x--;
    }
    cout<<ans;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -