Submission #926810

# Submission time Handle Problem Language Result Execution time Memory
926810 2024-02-13T20:02:33 Z NintsiChkhaidze Gondola (IOI14_gondola) C++17
0 / 100
0 ms 600 KB
#include "gondola.h"

int b[200005],c[200005];

int valid(int n, int a[]){
	int k = -1;
	for (int i=0;i<n;i++){
		if (b[i] > n) continue;
		if (k == -1) k= i;
		else if (a[k] > a[i]) k = i;
	}
	if (k==-1) return 1;
		
	int m = 0;
	int st = a[k];
	for (int j = k; j < n; j++)
		if (a[j] <= n) b[++m] = a[j],c[m] = st + (j - k);
	
	for (int j = 0; j < k; j++)
		if (a[j] <= n) b[++m] = a[j],c[m] = st + (n - k) + j + 1;
		
	for (int i = 1; i <= m; i++){
		if (b[i] != c[i]) 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 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 504 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -