# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
292080 | Badrangiikh | 곤돌라 (IOI14_gondola) | C++14 | 27 ms | 2680 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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[]){
int maxx , minn , indx , x ;
vector < int > vec ;
vector < pair < int , int > > vc ;
minn = n + 1 ;
for ( int i = 0 ; i < n ; i ++ ) {
if ( minn > gondolaSeq [ i ] ) {
indx = i ;
minn = gondolaSeq [ i ] ;
}
maxx = max ( maxx , gondolaSeq [ i ] ) ;
}
if ( minn <= n ) {
for ( int i = ( n + indx - minn ) % n + 1 ; i <= ( n + indx - minn ) % n + n ; i ++ ) {
vc . push_back ( { gondolaSeq [ i % n ] , i - ( ( n + indx - minn ) % n + 1 ) } ) ;
}
}
else {
for ( int i = 0 ; i < n ; i ++ ) {
vc . push_back ( { gondolaSeq [ i ] , i } ) ;
}
}
sort ( vc . begin ( ) , vc . end ( ) ) ;
x = n + 1 ;
for ( int i = 0 ; i < vc . size ( ) ; i ++ ) {
if ( vc [ i ] . first == vc [ i ] . second + 1 ) continue ;
vec . push_back ( vc [ i ] . second + 1 ) ;
for ( int j = x ; j <= vc [ i ] . first - 1 ; j ++ ) {
vec . push_back ( j ) ;
}
x = vc [ i ] . first + 1 ;
}
for ( int i = 0 ; i < vec . size ( ) ; i ++ ) {
replacementSeq [ i ] = vec [ i ] ;
}
return maxx - n ;
}
int countReplacement(int n, int inputSeq[]) {
return 0 ;
}
컴파일 시 표준 에러 (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... |