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.
|