# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
705668 | ToroTN | Gondola (IOI14_gondola) | C++14 | 30 ms | 5368 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>
using namespace std;
#include "gondola.h"
//#include "grader.cpp"
#define X first
#define Y second
#define pb push_back
#define ll long long
int a[100005];
int valid(int n, int inputSeq[])
{
set<int> s;
int type=1,pos[100005];
for(int i=0;i<n;i++)
{
a[i+1]=inputSeq[i];
}
for(int i=1;i<=n;i++)
{
if(a[i]<=n)pos[a[i]]=i;
s.insert(a[i]);
}
if(s.size()<n)type=0;
for(int i=1;i<n;i++)
{
if((!(pos[i]==n&&pos[i+1]==1)&&!(pos[i]+1==pos[i+1]))&&(pos[i]>=1&&pos[i]<=n)&&(pos[i+1]>=1&&pos[i+1]<=n))
{
type=0;
}
}
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... |