# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230286 | monus1042 | Gondola (IOI14_gondola) | C++17 | 5 ms | 384 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 <bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[])
{
unordered_set<int> ch;
for (int i=0; i<n; i++){
ch.insert(inputSeq[i]);
}
if (ch.size()==n){
int fi=-1, se=-1;
for (int i=0; i<n; i++){
if (1<=inputSeq[i] && inputSeq[i]<=n){
fi=inputSeq[i];
se=i;
break;
}
}
if (fi==-1){
return 1;
}else{
bool check=1;
for (int i=se, track=fi; i<se+n; i++, track++){
if (1<=inputSeq[i%n] && inputSeq[i%n]<=n){
if (inputSeq[i%n] == track){
}else{
check=0;
break;
}
}
}
if (check) return 1;
return 0;
}
}else{
return 0;
}
}
//----------------------
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... |