0_0_13721220_17288.cpp:1:1116: fatal error: GCC4.9.2/lib/gcc/x86_64-w64-mingw32/4.9.2/include/iostream>usin: Invalid argument
#include <iostream>using namespace std;struct node{ int value; int a,b;}tree[300010];int maketree(int i,int a,int b){ tree[i].a=a; tree[i].b=b; if(a==b) { return tree[i].value=1; } int mid=(a+b)/2; return tree[i].value =maketree(2*i,a,mid)+maketree(2*i+1,mid+1,b);}int update(int i,int a,int b,int v){ if(tree[i].a==tree[i].b) return tree[i].value =v; int mid=(tree[i].a+tree[i].b)/2; if(a>mid) //更新区间为右区间 return tree[i].value=update(2*i+1,a,b,v)+tree[2*i].value; else if(b<=mid) //更新区间为左区间 return tree[i].value=update(2*i,a,b,v)+tree[2*i+1].value; else //否则左右区间皆更新 return tree[i].value=update(2*i,a,mid,v)+update(2*i+1,mid+1,b,v);}int main(){ int a,b,t,q,v,i,n; scanf("%d",&t); for(i=1;i<=t;i++) { scanf("%d",&n); maketree(1,1,n); scanf("%d",&q); while(q--) { scanf("%d%d%d",&a,&b,&v); update(1,a,b,v); } printf("Case %d: The total value of the hook is %d.\n",i,tree[1].value); } return 0;}
^
compilation terminated.
|