| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1344055 | tkm_algorithms | Gondola (IOI14_gondola) | C++20 | 6 ms | 1092 KiB |
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define all(x) x.begin(), x.end()
#define rep(i, l, n) for (int i = l; i < (n); ++i)
#define sz(x) (int)x.size()
const char nl = '\n';
int valid(int n, int a[])
{
int pos, san = -1;
rep(i, 0, n)
if (a[i] <= n)pos = i, san = a[i];
if (san == -1)return 1;
vector<int> sb(n+1);
int x = san+1; sb[san] = pos;
if (x > n)x -= n;
while (x != san) {
sb[x] = (pos+1)%n;
pos += 1, x += 1;
if (x > n)x -= n;
}
bool ok = true;
rep(i, 0, n) {
if (a[i]>n)continue;
ok &= sb[a[i]] == i;
}
return ok;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
//1 2 3 4 5 6
//6 1 2 3 4 5
//5 6 1 2 3 4
//4 5 6 1 2 3
//3 4 5 6 1 2
//2 3 4 5 6 1
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
