0_0_21406333_19834.cpp:1:2: error: stray '#' in program
#include <bits/stdc++.h>
^
0_0_21406333_19834.cpp:1:9: error: stray '#' in program
#include <bits/stdc++.h>
^
0_0_21406333_19834.cpp:2:2: error: stray '#' in program
using namespace std;
^
0_0_21406333_19834.cpp:3:2: error: stray '#' in program
const int N = 4e5+100;
^
0_0_21406333_19834.cpp:4:2: error: stray '#' in program
typedef long long ll;
^
0_0_21406333_19834.cpp:5:2: error: stray '#' in program
int c[N],vis[N];///c数组表示第i个节点的颜色ci;vis为标记数组
^
0_0_21406333_19834.cpp:6:2: error: stray '#' in program
vector<int> e[N];///e数组用来存储树的信息
^
0_0_21406333_19834.cpp:7:2: error: stray '#' in program
ll sum[N],size[N];///sum数组模拟根节点i的子树相同颜色的个数;size[i]表示的是以i为根的点的个数,sun[i]-size[i]=与根节点不同的颜色的个数(sum,size表示是在统一课子树的)
^
0_0_21406333_19834.cpp:8:2: error: stray '#' in program
ll ans;///ans表示不经过颜色为i的路径总条数
^
0_0_21406333_19834.cpp:9:2: error: stray '#' in program
void dfs(int x,int y)///x表示当前节点,y表示其前一个节点
^
0_0_21406333_19834.cpp:10:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:11:2: error: stray '#' in program
^
0_0_21406333_19834.cpp:12:2: error: stray '#' in program
size[x]=1; //自身
^
0_0_21406333_19834.cpp:13:2: error: stray '#' in program
sum[c[x]]++; //加上自身
^
0_0_21406333_19834.cpp:14:2: error: stray '#' in program
ll pre=sum[c[x]]; //pre表示跟节点之前相同颜色的数量也就是最高的数到这个根节点之间的
^
0_0_21406333_19834.cpp:15:2: error: stray '#' in program
for(int i=0; i<e[x].size(); i++)
^
0_0_21406333_19834.cpp:16:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:17:2: error: stray '#' in program
^
0_0_21406333_19834.cpp:18:2: error: stray '#' in program
if(e[x][i]==y)
^
0_0_21406333_19834.cpp:19:2: error: stray '#' in program
continue;
^
0_0_21406333_19834.cpp:20:2: error: stray '#' in program
dfs(e[x][i],x);
^
0_0_21406333_19834.cpp:21:2: error: stray '#' in program
size[x]+=size[e[x][i]];/// 以x为根的树的点的总个数,当前的这个点还要加上他的子数上的点
^
0_0_21406333_19834.cpp:22:2: error: stray '#' in program
ll count=size[e[x][i]]-(sum[c[x]]-pre);///count表示与当前节点颜色不同的子节点个数
^
0_0_21406333_19834.cpp:23:2: error: stray '#' in program
ans=ans+(1LL*count*(count-1))/2;
^
0_0_21406333_19834.cpp:24:2: error: stray '#' in program
sum[c[x]]+=count;///将算入路径中的颜色模拟成节点x的颜色。以防更高根节点有相同颜色重复计算。这里注意,如果子树中无x颜色的点的个数为1时,也是构不成路径,但是也要算在sum[x]里面,因为这样的节点在整棵树中也是无法构成路径的
^
0_0_21406333_19834.cpp:25:2: error: stray '#' in program
pre=sum[c[x]]; //这里pre比之前多了子树部分的,防止其他新子树的影响
^
0_0_21406333_19834.cpp:26:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:27:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:28:2: error: stray '#' in program
^
0_0_21406333_19834.cpp:29:2: error: stray '#' in program
int main()
^
0_0_21406333_19834.cpp:30:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:31:2: error: stray '#' in program
int n,cas=1;
^
0_0_21406333_19834.cpp:32:2: error: stray '#' in program
while(scanf("%d",&n)!=EOF)
^
0_0_21406333_19834.cpp:33:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:34:2: error: stray '#' in program
int num=0;
^
0_0_21406333_19834.cpp:35:2: error: stray '#' in program
ans=0;
^
0_0_21406333_19834.cpp:36:2: error: stray '#' in program
memset(sum,0,sizeof(sum));
^
0_0_21406333_19834.cpp:37:2: error: stray '#' in program
memset(vis,0,sizeof(vis));
^
0_0_21406333_19834.cpp:38:2: error: stray '#' in program
for(int i=1; i<=n; i++)
^
0_0_21406333_19834.cpp:39:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:40:2: error: stray '#' in program
e[i].clear();
^
0_0_21406333_19834.cpp:41:2: error: stray '#' in program
scanf("%d",&c[i]);
^
0_0_21406333_19834.cpp:42:2: error: stray '#' in program
if(vis[c[i]]==0)
^
0_0_21406333_19834.cpp:43:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:44:2: error: stray '#' in program
vis[c[i]]=1;///标记ci颜色
^
0_0_21406333_19834.cpp:45:2: error: stray '#' in program
num++;
^
0_0_21406333_19834.cpp:46:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:47:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:48:2: error: stray '#' in program
for(int i=1; i<n; i++)
^
0_0_21406333_19834.cpp:49:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:50:2: error: stray '#' in program
int u,v;
^
0_0_21406333_19834.cpp:51:2: error: stray '#' in program
scanf("%d%d",&u,&v);
^
0_0_21406333_19834.cpp:52:2: error: stray '#' in program
e[u].push_back(v);
^
0_0_21406333_19834.cpp:53:2: error: stray '#' in program
e[v].push_back(u);
^
0_0_21406333_19834.cpp:54:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:55:2: error: stray '#' in program
dfs(1,0); //求与根节点相关点要减去路径的路数
^
0_0_21406333_19834.cpp:56:2: error: stray '#' in program
ll ANS = 1LL*num*((1LL)*n*(n-1))/2;/// 这里要算的就是整棵树中所有颜色都经过每一条路径的所有和
^
0_0_21406333_19834.cpp:57:2: error: stray '#' in program
for(int i=1; i<=n; i++) ///求与根节点无关的点要减去的路径数
^
0_0_21406333_19834.cpp:58:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:59:2: error: stray '#' in program
if(vis[i])
^
0_0_21406333_19834.cpp:60:2: error: stray '#' in program
{
^
0_0_21406333_19834.cpp:61:2: error: stray '#' in program
ll ct=n-sum[i];///ct表示模拟过后树中没有颜色i的节点个数
^
0_0_21406333_19834.cpp:62:2: error: stray '#' in program
ans+=ct*(ct-1)/2;
^
0_0_21406333_19834.cpp:63:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:64:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:65:2: error: stray '#' in program
printf("Case #%d: %lld\n", cas++, ANS-ans);
^
0_0_21406333_19834.cpp:66:2: error: stray '#' in program
}
^
0_0_21406333_19834.cpp:1:3: error: expected unqualified-id before numeric constant
#include <bits/stdc++.h>
^
0_0_21406333_19834.cpp:1:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:1:10: error: 'include' does not name a type
#include <bits/stdc++.h>
^
0_0_21406333_19834.cpp:3:3: error: expected unqualified-id before numeric constant
const int N = 4e5+100;
^
0_0_21406333_19834.cpp:3:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:4:3: error: expected unqualified-id before numeric constant
typedef long long ll;
^
0_0_21406333_19834.cpp:4:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:5:3: error: expected unqualified-id before numeric constant
int c[N],vis[N];///c数组表示第i个节点的颜色ci;vis为标记数组
^
0_0_21406333_19834.cpp:5:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:6:3: error: expected unqualified-id before numeric constant
vector<int> e[N];///e数组用来存储树的信息
^
0_0_21406333_19834.cpp:6:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:6:9: error: 'vector' does not name a type
vector<int> e[N];///e数组用来存储树的信息
^
0_0_21406333_19834.cpp:7:3: error: expected unqualified-id before numeric constant
ll sum[N],size[N];///sum数组模拟根节点i的子树相同颜色的个数;size[i]表示的是以i为根的点的个数,sun[i]-size[i]=与根节点不同的颜色的个数(sum,size表示是在统一课子树的)
^
0_0_21406333_19834.cpp:7:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:8:3: error: expected unqualified-id before numeric constant
ll ans;///ans表示不经过颜色为i的路径总条数
^
0_0_21406333_19834.cpp:8:3: error: expected constructor, destructor, or type conversion before numeric constant
0_0_21406333_19834.cpp:9:3: error: expected unqualified-id before numeric constant
void dfs(int x,int y)///x表示当前节点,y表示其前一个节点
^
0_0_21406333_19834.cpp:9:3: error: expected constructor, destructor, or type con
|