7842022-01-11 13:31:40kidesoKazamatacpp11Wrong answer 0/40167ms7680 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int N;
	cin >> N;
	
	vector <int> x(N);
	vector <int> y(N, 0);
	for (int i = 0; i < N; ++i) cin >> x[i];

	int r = 0, h_db=N;
	//y[0] = 1;
	int i = 0;

	while (h_db > 0)
	{
		if (y[(x[i] + r) % N] == 0) --h_db;
		y[(x[i] + r) % N] = 1;
		while (i < N - 1 && y[i] == 1)
		{
			++i;
			if (y[(x[i] + r) % N] == 0) --h_db;
			y[(x[i] + r) % N] = 1;
		}

		++r;
	}

	cout << r - 1;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Accepted0/02ms1740 KiB
2Wrong answer0/061ms2752 KiB
3Wrong answer0/21ms2112 KiB
4Wrong answer0/21ms2112 KiB
5Wrong answer0/21ms2120 KiB
6Wrong answer0/21ms2124 KiB
7Wrong answer0/21ms2136 KiB
8Wrong answer0/21ms2144 KiB
9Wrong answer0/22ms2144 KiB
10Wrong answer0/21ms2148 KiB
11Wrong answer0/2167ms4124 KiB
12Wrong answer0/271ms4608 KiB
13Wrong answer0/294ms5276 KiB
14Wrong answer0/296ms5852 KiB
15Wrong answer0/2134ms6420 KiB
16Wrong answer0/2104ms6996 KiB
17Wrong answer0/276ms7492 KiB
18Wrong answer0/257ms7680 KiB
19Wrong answer0/2105ms7672 KiB
20Wrong answer0/275ms7672 KiB
21Wrong answer0/2119ms7668 KiB
22Wrong answer0/2128ms7672 KiB