# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679140 | mseebacher | Gondola (IOI14_gondola) | C++17 | 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int valid(int n,int in[]){
map<int,bool> m;
m.insert({in[0],1});
for(int i = 1;i<n;i++){
if(in[i-1]+1 == in[i] || in[i] > n) continue;
if(in[i-1] == n && in[i] == 1) continue;
if(!m[in[i]]){
m.insert({in[i],1});
continue;
}
return false;
}
return true;
}