| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1360667 | nini_gvenetadze | 곤돌라 (IOI14_gondola) | C++20 | 965 ms | 756 KiB |
#include<bits/stdc++.h>
using namespace std;
#include "gondola.h"
int valid(int n, int inputseq[])
{
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
if(inputseq[i]==inputseq[j])
{
return 0;
}
}
}
int k=-1;
int c=-1;
for(int i=0; i<n; i++)
{
if(inputseq[i]<=n)
{
if(c==-1)
{
c=inputseq[i];
k=i;
continue;
}
if(inputseq[i]==1)
{
c=inputseq[i];
k=i;
continue;
}
if(inputseq[i]-c!=i-k)
{
return 0;
}
c=inputseq[i];
k=i;
}
}
return 1;
}
int replacement(int n, int gondolaseq[], int replacementseq[])
{
for(int i=0; i<n; i++)
{
for(int j=i+1; j<n; j++)
{
if(gondolaseq[i]==gondolaseq[j])
{
return 0;
}
}
}
int k=-1;
for(int i=0; i<n; i++)
{
if(gondolaseq[i]<=n)
{
k=i;
break;
}
}
if(k==-1)
{
for(int i=0; i<n; i++)
replacementseq[i]=i+1;
return n;
}
int ans=0;
int c=gondolaseq[k];
for(int i=0; i<n; i++)
{
int j=(k+i)%n;
int e=c+i;
if(e>n) e-=n;
if(gondolaseq[j]>n)
{
replacementseq[ans]=gondolaseq[j];
ans++;
}
else
{
if(gondolaseq[j]!=e)
{
replacementseq[ans]=e;
ans++;
}
}
}
return ans;
}
int countReplacement(int n, int inputSeq[]){
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
