F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

ZYB's Premutation

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 1670    Accepted Submission(s): 848


Problem Description
$ZYB$ has a premutation $P$,but he only remeber the reverse log of each prefix of the premutation,now he ask you to
restore the premutation.

Pair $(i,j)(i < j)$ is considered as a reverse log if $A_i>A_j$ is matched.
 

Input
In the first line there is the number of testcases T.

For each teatcase:

In the first line there is one number $N$.

In the next line there are $N$ numbers $A_i$,describe the number of the reverse logs of each prefix,

The input is correct.

$1 \leq T \leq 5$,$1 \leq N \leq 50000$
 

Output
For each testcase,print the ans.
 

Sample Input
1 3 0 1 2
 

Sample Output
3 1 2
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-03 10:43:30, Gzip enabled