# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
638240 | Seb | 곤돌라 (IOI14_gondola) | C++17 | 17 ms | 1236 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int valid(int n, int inputSeq[]) {
ll i,mn=0,aux[n];
bool resp=true;
for (i=0;i<n;i++) {
aux[i] = inputSeq[i];
if (aux[mn]>aux[i]) mn = i;
}
sort(aux,aux+n);
for (i=0;i<n-1;i++) if (aux[i]==aux[i+1]) return 0;
for (i=mn;i<n;i++) if (inputSeq[i]<=n) {
if (inputSeq[i]!=i-mn+1) resp = false;
}
for (i=0;i<mn;i++) if (inputSeq[i]<=n) {
if (inputSeq[i]!=(n-mn)+i+1) resp = false;
}
if (resp==true) return 1;
else return 0;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[]) {
ll i,mx=0,aux=1,j=0,p=0;
sort(gondolaSeq,gondolaSeq+n);
mx = gondolaSeq[n-1];
while (aux<mx) {
while (aux==gondolaSeq[j]) aux++;
if (aux<mx) {
replacementSeq[p] = aux;
p++;
j++;
}
}
return mx-n;
}
//----------------------
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... |