답안 #301985

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
301985 2020-09-18T10:53:04 Z MylnikovNikolay Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair <ll , ll> pll;
typedef pair <int , int> pii;

#define fi first
#define se second
//#define int ll

const int intf = 2e9 , maxn = 1e5 + 5;
const ll inf = 2e18 , mod = 1e9 + 7;


void solve(){
    int n , m; cin >> n >> m;
    vector <pii> a(n);
    vector <int> r(m);
    for (auto &x : a){
        cin >> x.se >> x.fi;
    }
    sort(a.begin() , a.end());
    for (auto &x : r){
        cin >> x;
    }
    sort(r.begin() , r.end());

    int i = 0 , j = 0 , ans = 0;
    while(i < n && j < m){
        if (a[i].se <= r[j]){
            j++;
            ans++;
        }
        i++;
    }
    cout << ans;
}

signed main() {
    //freopen("input.txt" , "r" , stdin);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.precision(20);

    int t = 1; //cin >> t;
    while(t-->0){
        solve();
    }

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -