| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1366163 | biserailieva | Carnival (EGOI23_carnival) | C++20 | 49 ms | 3048 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int>V[n];
bool s=true, rev=true;
for(int i=0;i<n-1;i++)
{
vector<int>A;
for(int j=0;j<i+1;j++)
{
int x;
cin>>x;
V[i].push_back(x);
A.push_back(x);
}
sort(A.begin(), A.end());
if(A!=V[i])
{
s=false;
}
reverse(A.begin(), A.end());
if(A!=V[i])
{
rev=false;
}
}
if(rev)
{
for(int i=0;i<n;i++)
{
cout<<i<<' ';
}
cout<<endl;
}
else if(s)
{
deque<int>dq;
int mid;
if(n%2==0)
{
mid=n/2;
}
else
{
mid=n/2+1;
}
dq.push_back(mid);
int last=1;
for(int i=0;i<n;i++)
{
if(i==mid)
{
continue;
}
if(last==1)
{
dq.push_front(i);
last=0;
}
else
{
dq.push_back(i);
last=1;
}
}
for(int d : dq)
{
cout<<d<<' ';
}
cout<<endl;
}
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
