# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
232070 | anonymous | Gondola (IOI14_gondola) | C++14 | 18 ms | 2044 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gondola.h"
#include <vector>
#include <iostream>
#define MAXN 100005
#define MAXV 250005
using namespace std;
int valid(int n, int inputSeq[])
{
vector <int> Vals;
bool b = true, has[MAXV]={};
for (int i=0; i<n; i++) {
if (inputSeq[i] <= n) {
Vals.push_back(inputSeq[i]);
}
if (has[inputSeq[i]]) {return(0);}
has[inputSeq[i]]=true;
}
for (int i=0; i<Vals.size(); i++) {
if (Vals[i] > Vals[(i+1)%Vals.size()] && !b) {return(0);}
b &= Vals[i] < Vals[(i+1)%Vals.size()] ;
}
return(1);
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |