| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1323381 | hynmj | Gondola (IOI14_gondola) | C++20 | 0 ms | 0 KiB |
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
int valid(int n, int a[])
{
set<int> s;
for (int i = 0; i < n; i++)
{
a[i]--;
s.insert(a[i]);
}
if (s.size() != n)
return 0;
int j = 0;
bool ok = 1;
for (int i = 0; i < n; i++)
{
if (a[i] < n)
{
ok = 0;
j = (i - a[i] + n) % n;
break;
}
}
if (ok)
return 1;
for (int k = 0; k < n; k++, j++)
{
if (a[i] < n && a[i] != k)
{
return 0;
}
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
