Submission #786127

# Submission time Handle Problem Language Result Execution time Memory
786127 2023-07-18T04:22:14 Z kebine Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 212 KB
#include<bits/stdc++.h>
 
using namespace std;
 
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<long long, long long>
// jangan kebiasa kalah
// kalo OI, sampah aja dulu, tapi jangan menutup kemungkinan buat AC

long long n,m,b[100069];
pll arr[100069];

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    long long i,j;
    cin>>n>>m;
    for(i=1;i<=n;i++)
    {
        cin>>arr[i].se>>arr[i].fi;
    }
    j = 1;
    bool pernah = 0;
    for(i=1;i<=m;i++)
    {
        cin>>b[i];
    }
    sort(arr+1,arr+n+1);
    sort(b+1,b+m+1);
    // i < j -> b[i] <= b[j] and arr[i].fi <= arr[j].fi
    // fi = val, se = size
    for(i=1;i<=n and j<=m;i++)
    {
        if(arr[i].se <= b[j])
        {
            pernah = 1;
            j++;
        }
    }
     j *= pernah;
    cout<<min(j,m)<<'\n';
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -