# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
430180 | Rouge_Hugo | Gondola (IOI14_gondola) | C++14 | 15 ms | 1596 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<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#include "gondola.h"
using namespace std;
int vis[250090];
int valid(int n, int a[])
{
int mn=2509090;int w=0;
for(int i=0;i<n;i++)
{
if(vis[a[i]])return 0;
vis[a[i]]=1;
mn=min(mn,a[i]);
if(mn==a[i])
w=i;
}
if(mn>=n)return 1;int x=mn;
for(int i=w+1;i<n;i++)
{x++;
if(a[i]>n)
{
a[i]=x;continue;
}
if(a[i]!=x)return 0;
}
x=a[n-1];
for(int i=0;i<w;i++)
{x++;
if(a[i]>n)
{
a[i]=x;continue;
}
if(a[i]!=x)return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
Compilation message (stderr)
# | 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... |