| ||||||||||
| 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 | |||||||||
老超时啊!!!!!!!!!!!!!!!!!!#include<iostream>
using namespace std;
int main()
{
int N,a[80000],sum=0,k,j,i;
cin>>N;
for(i=0;i<N;i++)
{
cin>>a[i];
}
for(j=0;j<N;j++)
{
for(k=j;k<N;k++)
if(a[k]>a[j])
break;
sum+=(k-j-1);
}
cout<<sum<<endl;
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator