이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
int valid(int n, int inputSeq[])
{
int mn = 1e7, start = 0, it = 0;
vector<int> vec(n);
for(int i = 0; i < n; i++)
{
if(inputSeq[i] < mn)
{
mn = inputSeq[i];
start = i;
}
}
for(int i = start; i < start + n; i++)
{
vec[it] = inputSeq[i % n];
it++;
}
int cur = mn;
for(int i = 0; i < n; i++, cur++)
{
if(vec[i] > n)
continue;
if(vec[i] != cur)
{
return 0;
}
}
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
int mx = 0, it = 0;
map<int, int> used;
for(int i = 0; i < n; i++)
{
mx = max(mx, gondolaSeq[i]);
used[gondolaSeq[i]] = true;
}
for(int i = n; i <= mx; i++)
{
if(!used[i])
{
replacementSeq[it] = i;
it++;
}
}
return it;
}
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... |