Submission #1110155

# Submission time Handle Problem Language Result Execution time Memory
1110155 2024-11-08T21:51:02 Z sunboi Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 336 KB
#include <bits/stdc++.h>

using namespace std;
#define int long long

const int INF = 1e18;


signed main(){
    int n, m; cin >> n >> m;
    vector<pair<int, int>> a(n);
    vector<int> c(m);
    for (int i = 0; i < n; i++){
        cin >> a[i].second >> a[i].first;
    }
    sort(a.begin(), a.end());
    for (int i = 0; i < m; i++){
        cin >> c[i];
    }
    sort(c.begin(), c.end());
    int ans = 0;
    for (int i = 0; i < m; i++){
        int cur = 0;
        
        int last = -1;
        for (int j = i; j < m; j++){
            int k = 0;
            while(k < n && (last == -1 || a[k].first >= a[last].first)){
                if (a[k].second <= c[j]){
                    cur++;
                    last = k;
                    break;
                }
                k++;
            }
        }
        ans = max(ans, cur);
    }
    cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Incorrect 1 ms 336 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Incorrect 1 ms 336 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Incorrect 1 ms 336 KB Output isn't correct
6 Halted 0 ms 0 KB -