Submission #127704

# Submission time Handle Problem Language Result Execution time Memory
127704 2019-07-10T02:57:18 Z Boxworld Gondola (IOI14_gondola) C++14
20 / 100
59 ms 5460 KB
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
const int maxN=100010;
int valid(int n, int inputSeq[]){
	map<int,int> M;
	int a[maxN*2],fir=-1,firN=n+1;
	for (int i=0;i<n;i++){
		a[n+i]=a[i]=inputSeq[i];
		if (M.count(a[i]))return 0;else M[a[i]]=1;
		if (1<=a[i]&&a[i]<=n)
		if (firN>a[i]){firN=a[i];fir=i;}
	}
	if (fir==-1)return 1;
	for (int i=fir+1;i<n+fir;i++)
	if (1<=a[i]&&a[i]<=n){
		if(a[i]-firN!=i-fir)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 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 380 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 19 ms 2576 KB Output is correct
7 Correct 13 ms 760 KB Output is correct
8 Correct 34 ms 4472 KB Output is correct
9 Correct 11 ms 1656 KB Output is correct
10 Correct 46 ms 5240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 19 ms 2552 KB Output is correct
7 Correct 13 ms 760 KB Output is correct
8 Correct 34 ms 4600 KB Output is correct
9 Correct 11 ms 1596 KB Output is correct
10 Correct 47 ms 5240 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 24 ms 2396 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 59 ms 5460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -