Submission #132796

# Submission time Handle Problem Language Result Execution time Memory
132796 2019-07-19T14:59:38 Z arthurconmy Kralj (COCI16_kralj) C++14
56 / 140
314 ms 19304 KB
/* Arthur Conmy / arthurconmy */
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <bitset>
#include <random>
#include <stack>
#include <deque>
#include <chrono>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef pair<int,int> pii;
#define REP(i, a, b) for (int i = int(a); i <= int(b); i++)
#define REPb(j, d, c) for (int j = int(d); j >= int(c); j--)
#define ff first
#define ss second
#define pb push_back
#define len(x) int((x).size())
#define endl "\n"

int main() // LL OR INT??
{
	#ifdef ARTHUR_LOCAL
		ifstream cin("input.txt");
	#endif

	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin>>n;

	vi A;

	REP(i,1,n)
	{
		int a;
		cin>>a;
		A.pb(a);
	}

	vi D;

	REP(i,1,n)
	{
		int d;
		cin>>d;
		D.pb(d);
	}

	deque<int> E;

	REP(i,1,n)
	{
		int e;
		cin>>e;
		E.pb(e);
	}

	sort(D.rbegin(),D.rend());
	sort(E.begin(),E.end());

	int ans=0;

	REP(i,0,n-1)
	{
		if(E.back() >= D[i])
		{
			ans++;
			E.pop_back();
		}

		else
		{
			E.pop_front();
		}
	}

	cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 230 ms 13796 KB Output is correct
2 Correct 224 ms 13016 KB Output is correct
3 Correct 275 ms 15972 KB Output is correct
4 Correct 278 ms 16228 KB Output is correct
5 Incorrect 285 ms 17652 KB Output isn't correct
6 Incorrect 280 ms 16868 KB Output isn't correct
7 Incorrect 297 ms 18152 KB Output isn't correct
8 Incorrect 266 ms 16356 KB Output isn't correct
9 Incorrect 314 ms 19304 KB Output isn't correct
10 Incorrect 304 ms 18404 KB Output isn't correct