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>
#include <gondola.h>
using namespace std;
map<int,int> mp;
int valid(int n, int a[])
{
int index=-1;
vector<int> real(n);
for(int i=0;i<n;++i){
if(mp.count(a[i]))
return 0;
++mp[a[i]];
}
for(int i=0; i<n; ++i)
if(a[i]<=n) {
index=i;
break;
}
if(index==-1)
return 1;
int cur=a[index];
cur=cur==n?1:cur+1;
for(int j=(index+1)%n; j!=index; j=(j+1)%n,cur=cur==n?1:cur+1)
if(a[j]<=n && a[j] !=cur)
return 0;
return 1;
}
int replacement(int n, int T[], int ans[]) {
return 0;
}
int countReplacement(int n, int T[]) {
return 0;
}
# | 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... |