Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

sbsbsbsbsbsbsbsbsbsbsbsbsbssbsbsbsbsb

Posted by gaochenjun at 2022-05-22 19:57:09 on Problem 2182
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator