Submission #295034

# Submission time Handle Problem Language Result Execution time Memory
295034 2020-09-09T12:45:35 Z shivensinha4 Kralj (COCI16_kralj) C++17
56 / 140
256 ms 19448 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 pair<int, int> ii;
#define endl '\n'


int main() {
	#ifdef shiven
	freopen("test.in", "r", stdin);
	#endif
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n; cin >> n;
	vi adv(n), a(n), b(n);
	for_(i, 0, n) cin >> adv[i];
	for_(i, 0, n) cin >> a[i];
	for_(i, 0, n) cin >> b[i];
	
	sort(a.begin(), a.end()); sort(b.begin(), b.end());
	int ptb = 0, ans = 0;
	for_(pta, 0, n) {
		while (ptb < n and b[ptb] < a[pta]) ptb++;
		if (ptb == n) break;
		ans += 1; ptb++;
	}
	
	cout << ans << endl;

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 189 ms 13704 KB Output is correct
2 Correct 185 ms 13048 KB Output is correct
3 Correct 228 ms 15864 KB Output is correct
4 Correct 234 ms 15996 KB Output is correct
5 Incorrect 228 ms 17384 KB Output isn't correct
6 Incorrect 229 ms 16760 KB Output isn't correct
7 Incorrect 241 ms 18096 KB Output isn't correct
8 Incorrect 222 ms 16248 KB Output isn't correct
9 Incorrect 256 ms 19448 KB Output isn't correct
10 Incorrect 247 ms 18168 KB Output isn't correct