Submission #83602

# Submission time Handle Problem Language Result Execution time Memory
83602 2018-11-09T13:14:52 Z luciocf Kralj (COCI16_kralj) C++14
56 / 140
944 ms 113544 KB
#include <bits/stdc++.h>

using namespace std;

const int maxn = 5e5+10;

int a[maxn], p[maxn], v[maxn];

int main(void)
{
	int n;
	cin >> n;

	for (int i = 1; i <= n; i++)
		cin >> a[i];
	for (int i = 1; i <= n; i++)
		cin >> p[i];
	for (int i = 1; i <= n; i++)
		cin >> v[i];

	sort(p+1, p+n+1);
	sort(v+1, v+n+1);

	int atual = 1, ans = 0;
	for (int i = 1; i <= n; i++)
	{
		while (v[atual] < p[i] && atual < n) atual++;

		if (v[atual] > p[i]) atual++, ans++;
		else break;
	}

	cout << ans << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 545 ms 13688 KB Output is correct
2 Correct 507 ms 21600 KB Output is correct
3 Correct 624 ms 32712 KB Output is correct
4 Correct 627 ms 42488 KB Output is correct
5 Incorrect 698 ms 53640 KB Output isn't correct
6 Incorrect 677 ms 64724 KB Output isn't correct
7 Incorrect 703 ms 77296 KB Output isn't correct
8 Incorrect 657 ms 87676 KB Output isn't correct
9 Incorrect 842 ms 101524 KB Output isn't correct
10 Incorrect 944 ms 113544 KB Output isn't correct