# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
52098 | spencercompton | 곤돌라 (IOI14_gondola) | C++17 | 48 ms | 4988 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
int valid(int n, int inputSeq[])
{
set<int> ss;
for(int i = 0; i<n; i++){
ss.insert(inputSeq[i]);
}
if(ss.size()!=n){
return 0;
}
pair<int, int> first;
first.first = n+1;
first.second = -1;
for(int i = 0; i<n; i++){
if(inputSeq[i]<first.first){
first.first = inputSeq[i];
first.second = i;
}
}
if(first.second==-1){
return 1;
}
int pos = first.second;
for(int i = 0; i<n; i++){
if(inputSeq[i]<=n && i!=((first.second+inputSeq[i]-first.first)%n)){
return 0;
}
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
pair<int, int> first;
first.first = n+1;
first.second = -1;
for(int i = 0; i<n; i++){
if(gondolaSeq[i]<first.first){
first.first = gondolaSeq[i];
first.second = i;
}
}
if(first.second==-1){
first.first = 1;
first.second = 0;
}
int cur[n];
for(int i = 1; i<=n; i++){
int pos = (i-first.first+first.second+n+n)%n;
cur[pos] = i;
}
vector<pair<int, int> > final;
for(int i = 0; i<n; i++){
final.push_back(make_pair(gondolaSeq[i],i));
}
int point = n+1;
int p = 0;
for(int i = 0; i<n; i++){
while(point<=final[i].first){
replacementSeq[p++] = cur[final[i].second];
cur[final[i].second] = point++;
}
}
return p;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
컴파일 시 표준 에러 (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... |