foo.cpp:1:1: error: 'include' does not name a type
include<cstdio>
^
foo.cpp: In function 'int main()':
foo.cpp:6:25: error: 'stdin' was not declared in this scope
freopen("link10.in","r",stdin);
^
foo.cpp:6:30: error: 'freopen' was not declared in this scope
freopen("link10.in","r",stdin);
^
foo.cpp:7:13: error: 'n' was not declared in this scope
scanf("%d",&n);
^
foo.cpp:7:14: error: 'scanf' was not declared in this scope
scanf("%d",&n);
^
foo.cpp:12:5: error: 'path' was not declared in this scope
path[i][0]=b;
^
foo.cpp:13:16: error: 'index' was not declared in this scope
path[i][1]=index[a];
^
foo.cpp:21:34: error: 'w' was not declared in this scope
for(i=1;i<=n;i++) scanf("%d",&w[i]); //读入每个点的权值
^
foo.cpp:25:7: error: 'index' was not declared in this scope
a=index[i]; //初始化
^
foo.cpp:30:11: error: 'path' was not declared in this scope
while(path[a][0]) //遍历与每个父亲节点相连的所有子节点
^
foo.cpp:32:11: error: 'w' was not declared in this scope
b=w[path[a][0]]; //读取当前子节点的权值
^
foo.cpp:48:25: error: 'printf' was not declared in this scope
printf("%d %d",max_t,w_t); //输出结果
^
foo.cpp:5:7: warning: unused variable 'j' [-Wunused-variable]
int i,j,a,b,k,sum,max_1,max_2,max_t=0,w_t=0;
^