F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_13802579_22978.cpp:1:1037: fatal error: GCC4.9.2/lib/gcc/x86_64-w64-mingw32/4.9.2/include/iostream>usin: Invalid argument
 #include <iostream>using namespace std;const int M=20000+5;const int Maxn=100000+5;int skill[M];int tree[Maxn];int lmax[M],lmin[M];int rmax[M],rmin[M];int lowbit(int t){return t&(-t);}void add(int i){    while(i<Maxn)    {        tree[i]++;        i+=lowbit(i);    }}int sum(int i){    int tot=0;    while(i>0)    {        tot+=tree[i];        i-=lowbit(i);    }    return tot;}int main(){    int T;    scanf("%d",&T);    while(T--)    {        int n,i;        scanf("%d",&n);                for(i=1;i<=n;i++)            scanf("%d",&skill[i]);        memset(tree,0,sizeof(tree));        for(i=1;i<=n;i++)        {            lmin[i]=sum(skill[i]);            lmax[i]=i-lmin[i]-1;            add(skill[i]);        }        memset(tree,0,sizeof(tree));        for(i=n;i>=1;i--)        {            rmin[i]=sum(skill[i]);            rmax[i]=sum(Maxn)-rmin[i];            add(skill[i]);        }        __int64 ans=0;        for(i=1;i<=n;i++)            ans+=lmax[i]*rmin[i]+lmin[i]*rmax[i];        printf("%I64d\n",ans);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ^
compilation terminated.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-23 10:16:00, Gzip enabled