| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360667 | nini_gvenetadze | Gondola (IOI14_gondola) | C++20 | 965 ms | 756 KiB |
#include<bits/stdc++.h>
using namespace std;
#include "gondola.h"
int valid(int n, int inputseq[])
{
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
if(inputseq[i]==inputseq[j])
{
return 0;
}
}
}
int k=-1;
int c=-1;
for(int i=0; i<n; i++)
{
if(inputseq[i]<=n)
{
if(c==-1)
{
c=inputseq[i];
k=i;
continue;
}
if(inputseq[i]==1)
{
c=inputseq[i];
k=i;
continue;
}
if(inputseq[i]-c!=i-k)
{
return 0;
}
c=inputseq[i];
k=i;
}
}
return 1;
}
int replacement(int n, int gondolaseq[], int replacementseq[])
{
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
if(gondolaseq[i]==gondolaseq[j])
{
return 0;
}
}
}
int k=-1;
for(int i=0; i<n; i++)
{
if(gondolaseq[i]<=n)
{
k=i;
break;
}
}
if(k==-1)
{
for(int i=0; i<n; i++)
replacementseq[i]=i+1;
return n;
}
int ans=0;
int c=gondolaseq[k];
for(int i=0; i<n; i++)
{
int j=(k+i)%n;
int e=c+i;
if(e>n) e-=n;
if(gondolaseq[j]>n)
{
replacementseq[ans]=gondolaseq[j];
ans++;
}
else
{
if(gondolaseq[j]!=e)
{
replacementseq[ans]=e;
ans++;
}
}
}
return ans;
}
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... | ||||
