답안 #735840

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
735840 2023-05-04T19:17:43 Z JellyTheOctopus Exhibition (JOI19_ho_t2) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

#define f first
#define s second

int N, M;
vector<pair<long long, long long>> P;
vector<long long> C;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> N >> M;
	P.resize(N);
	C.resize(M);
	for (int i = 0; i < N; i++) {
		cin >> P[i].s >> P[i].f;
	}
	for (int i = 0; i < M; i++) {
		cin >> C[i];
	}
	sort(P.begin(), P.end());
	sort(C.begin(), C.end());
	int i = 0;
	int j = 0;
	int ans = 0;
	while (i < N && j < M) {
		bool flag = false;
		while (P[i].s > C[j]) {
			j++;
			if (j == M) {
				flag = true;
				break;
			}
		}
		if (flag) break;
		ans++;
		j++;
		i++;
	}
	cout << ans << "\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -