| ||||||||||
| 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 | |||||||||
why WA? 3Q#include<iostream.h>
#include<stdio.h>
#define max 100000
int main()
{
unsigned long n,count=0,i,j;
__int64 h[max];
cin>>n;//读入牛的个数
count=0;
for(i=1;i<n+1;i++)
{
scanf("%I64d",&h[i]);//每个牛的高度
}
for(i=1;i<n;i++)
{
j=i+1;
while((h[i]>h[j])&&(j<=n))
{
count++;
j++;
}
}
printf("%u\n",count);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator