Submission #1015158

# Submission time Handle Problem Language Result Execution time Memory
1015158 2024-07-06T06:51:10 Z amirhoseinfar1385 Gondola (IOI14_gondola) C++17
Compilation error
0 ms 0 KB
#include "gondola.h"
#include<bits/stdc++.h>
using namespace std;
int inf=1e9+5;

int fas(int u,int v,int n){
  return (u-v+n+n)%n;
}

int valid(int n, int inputSeq[])
{
  int wh=-1,mn=inf;
  for(int i=0;i<n;i++){
    if(inputSeq[i]<mn){
      wh=i;
      mn=inputSeq[i];
    }
  }
  int last=mn,lastwh=wh;
  for(int i=0;i<n;i++){
    if(inputSeq[(i+wh)%n]<=n){
      if(fas(inputSeq[(i+wh)%n],last)!=fas(i,lastwh,n)){
        return 0;
      }
      last=inputSeq[(i+wh)%n];
    }
  }
  return 1;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:22:37: error: too few arguments to function 'int fas(int, int, int)'
   22 |       if(fas(inputSeq[(i+wh)%n],last)!=fas(i,lastwh,n)){
      |                                     ^
gondola.cpp:6:5: note: declared here
    6 | int fas(int u,int v,int n){
      |     ^~~