답안 #370547

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
370547 2021-02-24T05:54:49 Z vot808 Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 364 KB
#include "bits/stdc++.h"
using namespace std;
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef long long ll;
typedef vector<int> vi;
typedef array<int, 2> ii;
#define endl '\n'


int main() {
#ifdef mlocal
	freopen("test.in", "r", stdin);
#endif
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n, m; cin >> n >> m;
	vector<ii> pic(n);
	vi sz(m);
	for_(i, 0, n) cin >> pic[i][1] >> pic[i][0];
	sort(pic.begin(), pic.end());
	for_(i, 0, m) cin >> sz[i];
	sort(sz.begin(), sz.end());
	int ans = 0, pt = 0;
	for_(i, 0, n) {
		while (pt < m and sz[pt] < pic[i][1]) pt++;
		if (pt < m) {
			pt++;
			ans++;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -