Submission #1135679

#TimeUsernameProblemLanguageResultExecution timeMemory
1135679Ak_16Gondola (IOI14_gondola)C++20
Compilation error
0 ms0 KiB
#include <iostream>
#include "gondola.h"
using namespace std;
#define int long long
int p = 1e9+9;

int n;
int a[300005];
int b[300005];

int valid(n, a){
  int cnt=0;
  int sp;
  for(int i=0; i<n; i++){
    if(a[i]<=n){cnt++; sp = i;}
  }
  if(cnt==0){return 1;}
  
  else {
    
    for(int i=0; i<n; i++){
      a[(n+a[sp]-sp+i-1)%n] = b[i];
    }
    
    int bru=0;
    
    for(int i=0; i<n; i++){
      if(b[i]<=n&&b[i]!=i+1){bru=1;}
    }
    
    return (1-bru);
  }
}

int replacement(n, a, b){
  
}

countReplacement(n, a){
  
}

Compilation message (stderr)

gondola.cpp:11:11: error: 'long long int valid' redeclared as different kind of entity
   11 | int valid(n, a){
      |           ^
In file included from gondola.cpp:2:
gondola.h:8:5: note: previous declaration 'int valid(int, int*)'
    8 | int valid(int n, int inputSeq[]);
      |     ^~~~~
gondola.cpp:35:17: error: 'long long int replacement' redeclared as different kind of entity
   35 | int replacement(n, a, b){
      |                 ^
In file included from gondola.cpp:2:
gondola.h:10:5: note: previous declaration 'int replacement(int, int*, int*)'
   10 | int replacement(int n, int gondolaSeq[], int replacementSeq[]);
      |     ^~~~~~~~~~~
gondola.cpp:39:17: error: expected constructor, destructor, or type conversion before '(' token
   39 | countReplacement(n, a){
      |                 ^