mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
808996d897
5100-5199
25 lines
488 B
C++
25 lines
488 B
C++
#include <iostream>
|
|
#include <cstdio>
|
|
#include <algorithm>
|
|
using namespace std;
|
|
int a[1000010];
|
|
int main()
|
|
{
|
|
int t,ii,n,i,Min,ans;
|
|
scanf("%d",&t);
|
|
for (ii=1;ii<=t;ii++)
|
|
{
|
|
scanf("%d",&n);
|
|
for (i=1;i<=n;i++)
|
|
scanf("%d",&a[i]);
|
|
Min=a[n];
|
|
ans=0;
|
|
for (i=n-1;i>=1;i--)
|
|
{
|
|
if (a[i]>Min) ans++;
|
|
else Min=a[i];
|
|
}
|
|
printf("Case #%d: %d\n",ii,ans);
|
|
}
|
|
}
|