Submission #73240

# Submission time Handle Problem Language Result Execution time Memory
73240 2018-08-28T05:46:19 Z TuGSGeReL Gondola (IOI14_gondola) C++14
0 / 100
4 ms 572 KB
#include "gondola.h"
#include<bits/stdc++.h>
#define ll int
#define mp make_pair
#define pub push_back
#define pob pop_back
#define ss second
#define ff first
#define ext exit(0)
using namespace std;
ll i,j,z=0,y=-1;
vector<ll> v,vc;
map<ll,ll>m;
int valid(int n, int inputSeq[])
{
	for(i=0;i<n;i++){
		if(m[inputSeq[i]]==1) return 0;
		m[inputSeq[i]]++;
	}
	for(i=0;i<n;i++){
		if(inputSeq[i]<n) v.pub(inputSeq[i]);
		else v.pub(y);
	}
	for(i=0;i<n;i++){
		if(v[i]>0){
			int x=v[i]-1;
			j=i-1;
			if(j==-1) j+=n;
			while(x>=0){
				if(v[j]==0){
					if(v[j]!=x) return 0;
				}
				v[j]=x;
				x--;
				j--;
				if(j==-1) j=n-1;
			}
		}
	}
	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 4 ms 376 KB Output is correct
2 Incorrect 2 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 512 KB Output is correct
2 Incorrect 3 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 512 KB Output is correct
2 Incorrect 2 ms 512 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 512 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 512 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 512 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 512 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 512 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 512 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 572 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -