# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
238093 | Fasho | 곤돌라 (IOI14_gondola) | C++14 | 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>
#define N 1000005
#define ll long long int
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("badhair.gir","r",stdin);freopen ("badhair.cik","w",stdout);
#define mod 1000000007
#define fs(x,y) for(ll i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(ll i=x;i<=y;i++)
#define INF 1000000000005
#define ull unsigned long long int
ll ar[N];
int valid(int n, int inputSeq[])
{
ll x=-1;
fo(i,1,n)
ar[i]=inputSeq[i-1];
sort(ar+1,ar+n+1);
fo(i,2,n)
if(ar[i-1]==ar[i])
return 0;
fo(i,1,n)
ar[i]=inputSeq[i-1];
fo(i,i,n)
if(ar[i]<=n)
{
x=i;
break;
}
if(x==-1)
return 1;
int flag=0;
fo(i,x+1,n)
{
if(ar[i]<=n)
{
if((i-x+ar[x])%n!=ar[i])
return 0;
}
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}