Submission #737692

# Submission time Handle Problem Language Result Execution time Memory
737692 2023-05-07T14:47:13 Z shoryu386 Gondola (IOI14_gondola) C++17
10 / 100
9 ms 1492 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[])
{
	int baseline = -1;
	int baselineIdx = -1;
	for (int x = 0; x < n; x++){
		if (inputSeq[x] <= n){
			baseline = inputSeq[x];
			baselineIdx = x;
		}
	}
	
	if (baseline == -1){
		return 1;
	}
	
	//baseline is supposed to be at x+1
	int shiftsRight = baselineIdx+1 - baseline;
	int shifted[n];
	for (int x = 0; x < n; x++) {
		shifted[x] = inputSeq[(x + shiftsRight + n)%n];
	}
	
	for (int x = 0; x < n; x++){
		if (shifted[x] <= n && shifted[x] != x+1) return 0;
	}
	return 1;
}

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

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

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

int countReplacement(int n, int inputSeq[])
{
  return -3;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 4 ms 684 KB Output is correct
7 Correct 9 ms 1440 KB Output is correct
8 Correct 8 ms 1264 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 8 ms 1392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 308 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 4 ms 720 KB Output is correct
7 Correct 8 ms 1492 KB Output is correct
8 Correct 7 ms 1212 KB Output is correct
9 Correct 3 ms 596 KB Output is correct
10 Correct 8 ms 1340 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -