7832022-01-11 13:30:41kidesoKazamatacpp11Wrong answer 0/40150ms10504 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;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/02ms1744 KiB
2Wrong answer0/059ms2836 KiB
3Wrong answer0/21ms2128 KiB
4Wrong answer0/21ms2136 KiB
5Wrong answer0/21ms2144 KiB
6Wrong answer0/21ms2144 KiB
7Wrong answer0/22ms2152 KiB
8Wrong answer0/22ms2156 KiB
9Wrong answer0/22ms2164 KiB
10Wrong answer0/22ms2152 KiB
11Wrong answer0/2150ms4140 KiB
12Wrong answer0/267ms4628 KiB
13Wrong answer0/2116ms5300 KiB
14Wrong answer0/289ms5804 KiB
15Wrong answer0/2134ms6460 KiB
16Wrong answer0/2100ms7032 KiB
17Wrong answer0/2105ms7608 KiB
18Wrong answer0/257ms8104 KiB
19Wrong answer0/2115ms8768 KiB
20Wrong answer0/271ms9252 KiB
21Wrong answer0/2115ms9932 KiB
22Wrong answer0/2136ms10504 KiB