# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
291997 | Badrangiikh | Gondola (IOI14_gondola) | C++14 | 28 ms | 2296 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>
#include "gondola.h"
using namespace std;
int valid(int n, int inputSeq[]){
vector < pair < int , int > > vec ;
vector < int > vc ;
for ( int i = 0 ; i < n ; i ++ ) {
if ( inputSeq [ i ] <= n ) {
vec . push_back ( { inputSeq [ i ] , i } ) ;
}
vc . push_back ( inputSeq [ i ] ) ;
}
sort ( vc . begin ( ) , vc . end ( ) ) ;
for ( int i = 1 ; i < vc . size ( ) ; i ++ ) {
if ( vc [ i - 1 ] == vc [ i ] ) return 0 ;
}
sort ( vec . begin ( ) , vec . end ( ) ) ;
for ( int i = 1 ; i < vec . size ( ) ; i ++ ) {
if ( vec [ i ] . first - vec [ i - 1 ] . first != ( ( vec [ i ] . second - vec [ i - 1 ] . second ) % n + n ) % n ) {
return 0 ;
}
}
return 1 ;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
return 0 ;
}
int countReplacement(int n, int inputSeq[]) {
return 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... |