# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
309292 | jainbot27 | 곤돌라 (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>
// #include "gondola.h"
using namespace std;
#define f first
#define s second
#define pb push_back
#define ar array
#define all(x) x.begin(), x.end()
#define siz(x) (int)x.size()
#define FOR(x, y, z) for(int x = (y); x < (z); x++)
#define ROF(x, z, y) for(int x = (y-1); x >= (z); x--)
#define F0R(x, z) FOR(x, 0, z)
#define R0F(x, z) ROF(x, 0, z)
#define trav(x, y) for(auto&x:y)
using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<class T> inline bool ckmin(T&a, T b) {return b < a ? a = b, 1 : 0;}
template<class T> inline bool ckmax(T&a, T b) {return b > a ? a = b, 1 : 0;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const char nl = '\n';
const int mxN = 2e5 + 10;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;
int valid(int n, int* _inputSeq){
vi inputSeq(n);
F0R(i, n){
inputSeq[i] = _inputSeq[i];
inputSeq[i]--;
}
vi vals;
F0R(i, n){
vals.pb(inputSeq[i]);
}
sort(all(vals));
vals.resize(unique(all(vals))-vals.begin());
if(siz(vals)!=n) return 0;
if(vals[0]>=n) return 1;
int pos;
F0R(i, n){
if(inputSeq[i] < n){
pos = i;
break;
}
}
int ff = inputSeq[pos];
F0R(i, n){
if(inputSeq[i]<=n){
int dif = i - pos;
int should = (n + ff + dif)%n;
if(inputSeq[i] != should) return 0;
}
}
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
int copy[n];
}
int countReplacement(int n, int inputSeq[]){
}
// int32_t main(){
// ios_base::sync_with_stdio(0); cin.tie(0);
// return 0;
// }