Submission #918312

#TimeUsernameProblemLanguageResultExecution timeMemory
918312contest_altGondola (IOI14_gondola)C++17
10 / 100
7 ms772 KiB
#include "gondola.h"

#include <algorithm>

int valid( int n, int inputSeq[] ) {
  int shift_min = n, shift_max = -1;
  
  for( int i = 0 ; i < n ; i++ ){
    if( inputSeq[i] > n )
      continue;

    int shift = (inputSeq[i] - 1 + n - i) % n;

    shift_min = std::min( shift_min, shift );
    shift_max = std::max( shift_max, shift );
  }

  if( shift_max < 0 )
    return true;
  
  return shift_min == shift_max;
}

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

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

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

int countReplacement( int n, int inputSeq[] ) {
  return -3;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...