Submission #91156

# Submission time Handle Problem Language Result Execution time Memory
91156 2018-12-26T12:17:11 Z arman_ferdous Gondola (IOI14_gondola) C++17
10 / 100
12 ms 4964 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;

int valid(int n, int inputSeq[])
{
	int last = -1, start = -1, num = 1000000;
	for(int i = 0; i < n; i++) {
		if(inputSeq[i] > n) inputSeq[i] = -1;
		else {
			last = i;
			if(inputSeq[i] < num) 
				start = i, num = inputSeq[i];
		}
	}
	if(last == -1) return 1;
	for(int i = start; i < n; i++)
		if(inputSeq[i] + 1 && inputSeq[i] != num + i - start)
			return 0;
	int at0 = inputSeq[last] + n - last;
	for(int i = 0; i < start; i++)
		if(inputSeq[i] + 1 && inputSeq[i] != at0 + 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 2 ms 376 KB Output is correct
2 Correct 2 ms 500 KB Output is correct
3 Correct 2 ms 572 KB Output is correct
4 Correct 2 ms 572 KB Output is correct
5 Correct 2 ms 572 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 752 KB Output is correct
2 Correct 2 ms 784 KB Output is correct
3 Correct 2 ms 792 KB Output is correct
4 Correct 2 ms 856 KB Output is correct
5 Correct 2 ms 864 KB Output is correct
6 Correct 6 ms 1252 KB Output is correct
7 Correct 12 ms 1868 KB Output is correct
8 Correct 10 ms 2288 KB Output is correct
9 Correct 4 ms 2288 KB Output is correct
10 Correct 10 ms 2832 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2832 KB Output is correct
2 Correct 2 ms 2832 KB Output is correct
3 Correct 2 ms 2832 KB Output is correct
4 Correct 2 ms 2832 KB Output is correct
5 Correct 2 ms 2832 KB Output is correct
6 Correct 6 ms 2896 KB Output is correct
7 Correct 11 ms 3628 KB Output is correct
8 Correct 9 ms 4024 KB Output is correct
9 Correct 4 ms 4024 KB Output is correct
10 Correct 10 ms 4700 KB Output is correct
11 Incorrect 2 ms 4700 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4700 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4700 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4700 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4700 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4824 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4824 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4964 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -