| ||||||||||
| 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 | |||||||||
Re:Notice~恶心模拟题~#include<iostream>
using namespace std;
int main()
{
int tot, n, x, k, value[25], num[25];
cin>>tot;
while (tot--)
{
cin>>n;
memset(value, 0, sizeof(value));
memset(num, 0, sizeof(num));
for (int i = 1; i <= n; i++)
{
cin>>value[i];
k = 0;
num[i] = value[i] - value[i - 1];
for (int j = i; j > 0; j--)
{
if (num[j] != 0)
{
printf("%d ", ++k);
num[j]--;
break;
}
k++;
}
}
printf("\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator