14622022-10-17 18:51:51lacitoRendezéscpp11Wrong answer 0/40372ms14104 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<bool> megvan(n);
	vector<int> szoba(n);
	for (int i = 0; i < n; i++) {
		cin >> szoba[i];
	}
	int hany = 0;
	bool kesz = false;
	while(!kesz) {
		hany++;
		kesz = true;
		for (int i = 0; i < n; i++) {
			megvan[szoba[i]] = true;
			if (!megvan[i]) {
				kesz = false;
				break;
			}
		}
		for (int i = 0; i < n; i++) {
			szoba[i]++;
			szoba[i] %= n;
		}
	}
	cout << hany - 1;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Accepted0/03ms1936 KiB
2Wrong answer0/098ms2212 KiB
3Wrong answer0/22ms2528 KiB
4Wrong answer0/22ms2536 KiB
5Wrong answer0/22ms2700 KiB
6Wrong answer0/22ms2896 KiB
7Wrong answer0/26ms3112 KiB
8Wrong answer0/26ms3240 KiB
9Wrong answer0/26ms3340 KiB
10Wrong answer0/26ms3460 KiB
11Time limit exceeded0/2354ms3964 KiB
12Time limit exceeded0/2365ms4520 KiB
13Time limit exceeded0/2368ms5620 KiB
14Time limit exceeded0/1365ms6548 KiB
15Time limit exceeded0/2330ms7396 KiB
16Time limit exceeded0/2368ms8164 KiB
17Time limit exceeded0/2372ms9104 KiB
18Time limit exceeded0/2370ms9748 KiB
19Time limit exceeded0/2365ms10732 KiB
20Time limit exceeded0/1365ms11816 KiB
21Time limit exceeded0/2354ms12668 KiB
22Time limit exceeded0/2368ms13552 KiB
23Time limit exceeded0/2368ms14104 KiB