# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679137 | 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define MAXI (int)1e5
#define pb(x) push_back(x)
bool 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;
}