9432022-02-03 19:15:03nmarciKazamatacpp11Accepted 40/4050ms9772 KiB
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <algorithm>
#include <list>
using namespace std;
using ll = long long int;

int main(){
    int n;
    cin >> n;
    vector<int> v(n);
    for(auto& i : v){
        cin >> i;
    }
    int reset = 0;
    int i = 0;
    vector<bool> ok(n + 1);
    while(i < n){
        ok[(v[i] + reset) % n] = true;
        if(!ok[i]){
            ++reset;
            i = 0;
        }
        else{
            ++i;
        }
    }
    cout << reset << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base40/40
1Accepted0/02ms1740 KiB
2Accepted0/025ms2428 KiB
3Accepted2/21ms2144 KiB
4Accepted2/22ms2144 KiB
5Accepted2/21ms2152 KiB
6Accepted2/21ms2148 KiB
7Accepted2/22ms2164 KiB
8Accepted2/22ms2164 KiB
9Accepted2/22ms2164 KiB
10Accepted2/21ms2172 KiB
11Accepted2/235ms3412 KiB
12Accepted2/239ms3996 KiB
13Accepted2/239ms4652 KiB
14Accepted2/239ms5140 KiB
15Accepted2/234ms5728 KiB
16Accepted2/250ms6304 KiB
17Accepted2/232ms6880 KiB
18Accepted2/235ms7460 KiB
19Accepted2/235ms8036 KiB
20Accepted2/241ms8612 KiB
21Accepted2/237ms9188 KiB
22Accepted2/241ms9772 KiB