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>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define MOD 1000000007
#define MOD1 1000000009
map<int,int> mp;
map<int,int> :: iterator it;
int valid(int n, int inputSeq[]) {
int pos = -1;
for(int i = 0; i < n; i ++) {
if(inputSeq[i] < n) {
pos = i;
}
mp[inputSeq[i]] ++;
}
for(it = mp.begin(); it != mp.end(); it ++) {
if(it -> ss > 1) {
return 0;
}
}
if(pos == -1) {
for(;;);
return 1;
}
int val = inputSeq[pos];
for(int i = pos + 1; i < n; i ++) {
val ++;
if(val == n) val = 0;
if(inputSeq[i] < n && inputSeq[i] != val) return 0;
}
for(int i = 0; i < pos; i ++) {
val ++;
if(val == n) val = 0;
if(inputSeq[i] < n && inputSeq[i] != val) 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... |