This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
░░░░██████████████████
░░▄███████▀▀▀▀▀▀███████▄
░▐████▀▒mohammad▒▀██████▄
░███▀▒▒▒▒alaa▒▒▒▒▒▒▀█████
░▐██▒▒▒alwrawrah▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
#include<bits/stdc++.h>
#include "gondola.h"
using namespace std;
typedef long long ll ;
const ll oo = 4294967296 ;
const double PI = acos(-1) ;
const ll M = 998244353 ;
map<int,int> mp;
int valid(int n, int inputSeq[]){
bool b = false ;
for(int i = 0 ; i < n ; ++i){
mp[inputSeq[i]]++;
if(mp[inputSeq[i]] > 1)return 0;
if(inputSeq[i] <= n){
b = 1 ;
int x = inputSeq[i];
int f = i - 1;
while(f > -1 && inputSeq[f] > n){
x--;
if(x == 0) x = n;
inputSeq[f] = x;
mp[x]++;
if(mp[x] > 1) return 0 ;
f--;
}
f = i + 1 ;
x = inputSeq[i];
while(f < n && inputSeq[f] > n){
x++;
if(x == n + 1) x = 1;
inputSeq[f] = x;
mp[x]++;
if(mp[x] > 1)return 0;
f++;
}
}
}
if(b){
for(int i = 1 ; i < n ; ++i)
if((inputSeq[i] == 1 && inputSeq[i - 1] != n) || (inputSeq[i] != 1 && inputSeq[i - 1] + 1 == inputSeq[i])) 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... |