Submission #926812

# Submission time Handle Problem Language Result Execution time Memory
926812 2024-02-13T20:08:01 Z NintsiChkhaidze Gondola (IOI14_gondola) C++17
10 / 100
7 ms 1372 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
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;
	
	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 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 356 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 3 ms 860 KB Output is correct
7 Correct 7 ms 1372 KB Output is correct
8 Correct 6 ms 1220 KB Output is correct
9 Correct 2 ms 604 KB Output is correct
10 Correct 7 ms 1340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 3 ms 860 KB Output is correct
7 Correct 7 ms 1372 KB Output is correct
8 Correct 7 ms 1112 KB Output is correct
9 Correct 2 ms 604 KB Output is correct
10 Correct 7 ms 1372 KB Output is correct
11 Incorrect 0 ms 348 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 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 -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 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 348 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 -
# 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 -