# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
403878 | Iwanttobreakfree | Gondola (IOI14_gondola) | C++98 | 0 ms | 0 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 <set>
using namespace std;
int valid(int n, int inputSeq[]){
int mini=1e9,pos,cont=0;
for(int i=0;i<n;i++){
if(inputSeq[i]<mini){
mini=inputSeq[i];
pos=i;
}
}
vector<int>v(n);
for(int i=pos;i<n;i++){
v[cont]=inputSeq[i];
cont++;
}
for(int i=0;i<pos;i++){
v[cont]=inputSeq[i];
cont++;
}
for(int i=0;i<n;i++){
if(v[i]>n){
if(s.find(v[i]==s.end())){
s.insert(v[i]);
}
else return 0;
}
if(v[i]-mini!=i)return 0;
}
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
/*int mini=1e9,pos,cont=0;
for(int i=0;i<n;i++){
if(inputSeq[i]<mini){
mini=inputSeq[i];
pos=i;
}
}
vector<int>v(n);
for(int i=pos;i<n;i++){
v[cont]=inputSeq[i];
cont++;
}
for(int i=0;i<pos;i++){
v[cont]=inputSeq[i];
cont++;
}*/
return 0;
}
int countReplacement(int n, int inputSeq[]){
return -3;
}