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 "gondola.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
int valid(int n, int a[]){
map<int,int> mp;
for(int i=0;i<n;i++){
if(mp[a[i]]!=0) return 0;
mp[a[i]]=1;
}
vector<pair<int,int>> v;
for(int i=0;i<n;i++){
if(a[i]<=n){
v.push_back({a[i],i});
}
}
sort(v.begin(),v.end());
for(int i=1;i<(int)v.size();i++){
int k=(v[i].first-v[i-1].first);
int s=(v[i].second-v[i-1].second+n)%n;
if(k!=s) return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
# | 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... |