| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360445 | gvancak | Gondola (IOI14_gondola) | C++20 | 0 ms | 344 KiB |
#include "gondola.h"
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
//int gondolaSequence[100001];
//int replacementSequence[250001];
int valid(int n, int inputSeq[])
{
int a[n+5];
for (int i=0; i<n; i++) a[i]=inputSeq[i];
map <ll,ll> m;
m.clear();
bool ok=0;
int x,y;
x=a[0]; y=0;
for (int i=0; i<n; i++){
m[a[i]]++;
if (m[a[i]]>1){
ok=1; break;
}
if (x>a[i]){
x=a[i]; y=i;
}
}
if (ok) return 0;
if (x>n) return 1;
for (int i=0; i<n; i++) a[i+n]=a[i];
for (int i=y; i<y+n; i++){
if (x>n) x-=n;
if (a[i]>n || a[i]==x){
x++; continue;
}
ok=1; break;
}
if (ok) return 0;
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return 0;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
