| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
sbsbsbsbsbsbsbsbsbsbsbsbsbssbsbsbsbsb#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int a[10000],b[100000],c,d,i,j;
cin>>d;
c=1;
a[0]=0;
for(i=1;i<d;i++)
{
cin>>a[i];
}
for(i=0;i<d;i++)
{
for(j=d-1;j>=0;j--)
{
if(a[j]==0)
{
b[j]=c;
c++;
a[j]--;
break;
}
else
{
a[j]--;
}
}
}
for(i=0;i<d;i++)
{
cout<<b[i]<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator