Submission #385846

#TimeUsernameProblemLanguageResultExecution timeMemory
385846mehrdad_sohrabiGondola (IOI14_gondola)C++14
Compilation error
0 ms0 KiB
// Black lives matter
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
typedef long long int ll;
typedef complex<double> point;
typedef long double ld;
#define pb push_back
#define pii pair < ll , ll >
#define F first
#define S second
//#define endl '\n'
#define int long long
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define kill(x) return cout<<x<<'\n', 0;
const int N=25e4+10;
int valid(int32_t n, int32_t input[]){
    ll id=-1;
    for (int i=0;i<n;i++){
        if (input[i]<=n){
            id=i;
        }
    }
    ll z=input[id]-id+n;
    z%=n;
    for (int i=0;i<n;i++){
        if (input[i]<=n){
            ll f=input[i]-i+n;
            f%=n;
            if (f!=z) return 0;
        }
    }
    vector <int> a;
    for (int i=0;i<n;i++){
        a.pb(input[i]);
    }
    return 1;
}

int replacement(int32_t n, int32_t gondolaSeq[], int32_t replacementSeq[]){
    return 0;
}

int countReplacement(int32_t n, int32_t inputSeq[]){
    return 0;
}
/*
int32_t in[N];
int32_t main(){
    ll n;
    cin >> n;
    for (int i=1;i<=n;i++){
        cin >> in[i-1];
    }
    kill(valid(n,in));
}
*/
/*

int gondolaSequence[100001];
int replacementSequence[250001];

int32_t main()
{
  int i, n, tag;
  int nr;
  assert(scanf("%d", &tag)==1);
  assert(scanf("%d", &n)==1);
  for(i=0;i< n;i++)
    assert( scanf("%d", &gondolaSequence[i]) ==1);

  switch (tag){
  case 1: case 2: case 3:
    printf("%d\n", valid(n, gondolaSequence));
    break;

  case 4: case 5: case 6:
    nr = replacement(n, gondolaSequence, replacementSequence);
    printf("%d ", nr);
    if (nr > 0)
      {
	for (i=0; i<nr-1; i++)
	  printf("%d ", replacementSequence[i]);
	printf("%d\n", replacementSequence[nr-1]);
      }
    else printf("\n");
    break;

  case 7: case 8: case 9: case 10:
    printf("%d\n",  countReplacement(n, gondolaSequence));
    break;
  }

  return 0;
}
*/

Compilation message (stderr)

gondola.cpp:18:5: error: ambiguating new declaration of 'long long int valid(int32_t, int32_t*)'
   18 | int valid(int32_t n, int32_t input[]){
      |     ^~~~~
In file included from gondola.cpp:3:
gondola.h:8:5: note: old declaration 'int valid(int, int*)'
    8 | int valid(int n, int inputSeq[]);
      |     ^~~~~
gondola.cpp:41:5: error: ambiguating new declaration of 'long long int replacement(int32_t, int32_t*, int32_t*)'
   41 | int replacement(int32_t n, int32_t gondolaSeq[], int32_t replacementSeq[]){
      |     ^~~~~~~~~~~
In file included from gondola.cpp:3:
gondola.h:10:5: note: old declaration 'int replacement(int, int*, int*)'
   10 | int replacement(int n, int gondolaSeq[], int replacementSeq[]);
      |     ^~~~~~~~~~~
gondola.cpp:45:5: error: ambiguating new declaration of 'long long int countReplacement(int32_t, int32_t*)'
   45 | int countReplacement(int32_t n, int32_t inputSeq[]){
      |     ^~~~~~~~~~~~~~~~
In file included from gondola.cpp:3:
gondola.h:12:5: note: old declaration 'int countReplacement(int, int*)'
   12 | int countReplacement(int n, int inputSeq[]);
      |     ^~~~~~~~~~~~~~~~