55042023-07-03 23:29:24AndrosKártyajátékcpp17Time limit exceeded 11/30500ms5668 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];
		if (t[i] < kivett_max) continue;

		//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
base11/30
1Accepted0/03ms1876 KiB
2Time limit exceeded0/0500ms2072 KiB
3Accepted1/12ms2288 KiB
4Accepted1/13ms2524 KiB
5Accepted1/13ms2732 KiB
6Accepted2/23ms2952 KiB
7Accepted2/23ms3136 KiB
8Accepted2/23ms3224 KiB
9Accepted1/167ms4404 KiB
10Time limit exceeded0/2462ms3416 KiB
11Time limit exceeded0/3469ms3612 KiB
12Time limit exceeded0/3425ms3880 KiB
13Accepted1/1119ms5668 KiB
14Time limit exceeded0/2455ms3952 KiB
15Time limit exceeded0/3481ms3988 KiB
16Time limit exceeded0/3449ms4000 KiB
17Time limit exceeded0/3465ms4140 KiB