55032023-07-03 23:26:18AndrosKártyajátékcpp17Time limit exceeded 9/30500ms4200 KiB
#include <iostream>
#define ll long long

using namespace std;

int main()
{

	ll n, k;
	cin >> n >> k;
	ll* t = new ll[k];
	for (int i = 0; i < k; i++)
	{
		cin >> t[i];
	}

	//cout << "Calculating..." << endl;
	ll pontszam = 0;
	ll kivett_max = 0;
	for (int i = 0; i < k; i++)
	{
		ll szam = t[i];

		//Végigmegy a maradékon
		for (int j = i + 1; j < k; j++)
		{
			//Ha van ami kisebb, de az eddigieknél nagyobb.
			if (t[j] < szam && t[j] > kivett_max) {
				pontszam++;
				break;
			}
		}

		kivett_max = max(kivett_max, szam);//Sokkal szebb.

	}
	cout << pontszam;

}
SubtaskSumTestVerdictTimeMemory
base9/30
1Accepted0/03ms1748 KiB
2Time limit exceeded0/0500ms1896 KiB
3Accepted1/13ms2144 KiB
4Accepted1/13ms2332 KiB
5Accepted1/12ms2420 KiB
6Accepted2/24ms2556 KiB
7Accepted2/24ms2792 KiB
8Accepted2/24ms3004 KiB
9Time limit exceeded0/1500ms2924 KiB
10Time limit exceeded0/2453ms3268 KiB
11Time limit exceeded0/3476ms3444 KiB
12Time limit exceeded0/3456ms3836 KiB
13Time limit exceeded0/1430ms3788 KiB
14Time limit exceeded0/2456ms3996 KiB
15Time limit exceeded0/3469ms4044 KiB
16Time limit exceeded0/3458ms4064 KiB
17Time limit exceeded0/3474ms4200 KiB