#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
list<int> arr;
for (int i = 0; i < n; ++i)
{
int t;
cin >> t;
arr.push_back(t);
}
vector<int> ans(n,0);
int index = 1;
while (!arr.empty())
{
int now = arr.front(); arr.pop_front();
int t = now;
auto ite = ans.begin();
int i = 0;
while (i < t)
{
if (*ite == 0)
++i;
++ite;
}
while (*ite != 0)
++ite;
*ite = index;
++index;
}
for (auto i : ans)
cout << i << ' ';
cout << endl;
}
슈발 봐라
잡대컴공(stakeholder)
2016-02-05 16:09
추천 0
댓글 2
다른 게시글
-
JMBook 이거 책 순서 왜 이러냐.ㅁㅇ(211.222) | 16.02.05추천 0
-
26세에 프로그래밍 입문하면 죽도밥도안됨? [8]BrunoMars(tkscjd7419) | 16.02.05추천 0
-
형아들 이 문제 어떻게 접근해야됨?슈발(183.96) | 16.02.05추천 0
-
수강신청 빨리하는 팁좀 줘라 [6]익명(59.12) | 16.02.05추천 0
-
학원 국비 지원으로 다니면 얼마나 지원해줘? [2]1672364366(118.33) | 16.02.05추천 0
-
세상을구할사람아 만약 대기업에서 니 아이디어 산다고하면 팔거야? [2]asda(183.108) | 16.02.05추천 0
-
소멤 관심있어하는 갤러들을 위해 문제 풀어주면 [1]익명(39.7) | 16.02.05추천 0
-
It뱅크 브로커 상담사 노답 [3]encoder(encoder) | 16.02.05추천 0
-
윈도우 서버 관리하시는 횽들 좀 봐주세요.중국산(tingkoking) | 16.02.05추천 0
-
개발자라면 윈도우지 [1]익명(110.70) | 16.02.05추천 0
저 while문에 대한 invariant : arr에서 나온 원소가 가장 작은 원소인 걸 이용하면 됨.
역시...성컴