답안 #316896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
316896 2020-10-28T13:50:20 Z CodeTiger927 Kralj (COCI16_kralj) C++14
56 / 140
1218 ms 6368 KB
using namespace std;

#include <iostream>
#include <algorithm>

#define MAXN 500005

int arr[MAXN],strM[MAXN],strS[MAXN],N;

int main() {
	cin >> N;
	for(int i = 0;i < N;++i) cin >> arr[i];
	for(int i = 0;i < N;++i) cin >> strM[i];
	for(int i = 0;i < N;++i) cin >> strS[i];
	
	sort(strM,strM + N);
	sort(strS,strS + N);

	int ans = 0;
	int l = 0;
	int r = 0;
	while(l < N && r < N) {
		if(strS[l] > strM[r]) {
			ans++;l++;r++;
		}else if(strS[l] < strM[r]) l++;
	}
	cout << ans << endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 835 ms 5084 KB Output is correct
2 Correct 804 ms 4984 KB Output is correct
3 Correct 983 ms 6028 KB Output is correct
4 Correct 970 ms 6276 KB Output is correct
5 Incorrect 1099 ms 5752 KB Output isn't correct
6 Incorrect 1067 ms 5752 KB Output isn't correct
7 Incorrect 1140 ms 6008 KB Output isn't correct
8 Incorrect 1027 ms 5368 KB Output isn't correct
9 Incorrect 1218 ms 6268 KB Output isn't correct
10 Incorrect 1143 ms 6368 KB Output isn't correct