Submission #537370

# Submission time Handle Problem Language Result Execution time Memory
537370 2022-03-15T03:56:04 Z kawaii Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

int t, n, m, mod = 1e9 + 7; 
mt19937_64 rng;

struct point{
    int s, h;
};

bool operator < (point a, point b){
    return a.h < b.h;
}

point a[1000005];
int b[1000005];  

void solve(){  
    int num = 0, crr = m;
    for(int i = n; i >= 1; i--){
        if(a[i].s <= b[crr]){
            num++; crr--;
            if(crr == 0) break;
        }
    }
    cout << num <<" ";
}

signed main(){
    ios_base::sync_with_stdio(NULL); cin.tie(nullptr); cout.tie(nullptr);
    rng.seed((int)main ^ time(0));
    #ifdef Kawaii
        auto starttime = chrono::high_resolution_clock::now();
    #endif

    cin >> n >> m;
    for(int i = 1; i <= n; i++) cin >> a[i].s >> a[i].h; 
    for(int i = 1; i <= m; i++) cin >> b[i]; 
    sort(b + 1, b + m + 1);
    sort(a + 1, a + n + 1); 
    solve();

    #ifdef Kawaii
        auto endtime = chrono::high_resolution_clock::now();
        auto duration = chrono::duration_cast<chrono::milliseconds>(endtime - starttime).count(); 
        cout << "\n=====" << "\nUsed: " << duration << " ms\n";
    #endif
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -