# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230264 | Masterdan | Gondola (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 "grader.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector <int> vi;
typedef pair <int, int> ii;
typedef vector <ii> vii;
#define mp make_pair
#define pb push_back
#define all(a) a.begin (),a.end ()
#define MAX 1000000000
#define MIN -1
#define F first
#define S second
int valid(int n, int inputSeq[])
{
int sw=0;
int c=0;
int v[n+1];
for(int i=0;i<n;i++)v[i]=inputSeq[i];
//v=inputSeq;
for(int i=1;i<n;i++){
if(v[i]<=v[i-1])c++;
if(c==2)return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
vi v;
int sw=0;
for(int i=0;i<n;i++)v.pb(gondolaSeq[i]);
sort(all(v));
for(int i=0;i<n;i++){
if(v[i]!=i+1){replacementSeq[0]=i+1;
sw=1;
break;
}
}
return sw;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}