10022022-02-21 13:00:12sjRészekre (40)cpp11Wrong answer 6/40596ms5524 KiB
//njudge
#include<bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	vector<int> sor(n);
	for(int i=0;i<n;i++) {
		cin>>sor[i];
	}
	//vector<queue<int>> sorok(n);
	vector<bool> inc(n);
	int k=0;
	int p=-1;
	for(int i=0;i<n;i++) {
		if(!inc[i]) {
			if(sor[i]>p) {
				p=sor[i];inc[i]=true;
			}
			else if(i==n-1) {
				i=0;
				k++;
				p=-1;
			}
		}
	}
	k++;
	cout<<k;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base6/40
1Accepted0/02ms1776 KiB
2Wrong answer0/0252ms3288 KiB
3Wrong answer0/21ms2524 KiB
4Wrong answer0/21ms2524 KiB
5Wrong answer0/22ms2536 KiB
6Accepted3/32ms2540 KiB
7Wrong answer0/38ms2556 KiB
8Accepted3/321ms2588 KiB
9Wrong answer0/398ms2740 KiB
10Wrong answer0/393ms3248 KiB
11Wrong answer0/3130ms3880 KiB
12Time limit exceeded0/3593ms3640 KiB
13Time limit exceeded0/4596ms4272 KiB
14Time limit exceeded0/4596ms4896 KiB
15Time limit exceeded0/5577ms5524 KiB