Submission #1023636

# Submission time Handle Problem Language Result Execution time Memory
1023636 2024-07-15T03:58:37 Z danglayloi1 Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>
#define ii pair<int, int>
#define fi first
#define se second
#define inf 0x3f3f3f3f3f3f3f3f
using namespace std;
using ll = long long;
const ll mod=1e9+7;
const int nx=1e5+5;
int n, m, f[nx], lim[nx], d, c, g, ans;
ii a[nx];
bool cmp(ii a, ii b)
{
    if(a.se==b.se)
        return a.fi<b.fi;
    return a.se>b.se;
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin>>n>>m;
    for(int i = 1; i <= n; i++)
        cin>>a[i].fi>>a[i].se;
    sort(a+1, a+n+1, cmp);
    for(int i = 1; i <= m; i++)
        cin>>f[i];
    sort(f+1, f+m+1, greater<int>());
    ans=1;
    for(int i = 1; i <= n; i++)
        if(a[i].fi<=f[ans])
            ans++;
    cout<<ans-1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -