Submission #1308278

#TimeUsernameProblemLanguageResultExecution timeMemory
1308278RaresGondola (IOI14_gondola)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;

const int MAXN=1e6+10;
const int MOD=1e9+9;

int f[MAXN];

bool valid (int n, int a[]){
    int x=-1;
    for (int i=1;i<=n;++i){
        if (a[i]>n) continue;
        int crt=a[i]-i;
        if (crt<0) crt+=n;
        if (x==-1){
            x=crt;
        }
        else{
            if (x!=crt) return false;
        }
    }
    return true;
}

Compilation message (stderr)

gondola.cpp:10:6: error: ambiguating new declaration of 'bool valid(int, int*)'
   10 | bool valid (int n, int a[]){
      |      ^~~~~
In file included from gondola.cpp:2:
gondola.h:8:5: note: old declaration 'int valid(int, int*)'
    8 | int valid(int n, int inputSeq[]);
      |     ^~~~~