forked from BitsPleaseMSI/BitsPlease-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
21.cpp
33 lines (32 loc) · 1.11 KB
/
21.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include<iostream>
using namespace std;
int main()
{
int t_cases,n,i,j,l_tow[10],sig;
cin>>t_cases;
while(t_cases)
{
cin>>n;
for(i=0;i<n;i++)
cin>>l_tow[i];
for(i=0;i<n;i++)
{
j=i-2;
sig=1;
if(i==0)
sig=0;
if(l_tow[j+1]<l_tow[i])
while(j>=0)
{
sig++;
if(l_tow[j]>=l_tow[i])
break;
j--;
}
cout<<sig<<" ";
}
cout<<"\n";
t_cases--;
}
return 0;
}