結果

問題 No.1418 Sum of Sum of Subtree Size
ユーザー tailstails
提出日時 2021-03-10 16:07:36
言語 cLay
(20231016-1)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 2,372 ms
コンパイル使用メモリ 161,472 KB
実行使用メモリ 17,160 KB
最終ジャッジ日時 2023-09-19 02:14:09
合計ジャッジ時間 6,623 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,320 KB
testcase_01 AC 2 ms
5,356 KB
testcase_02 AC 2 ms
5,512 KB
testcase_03 AC 14 ms
10,768 KB
testcase_04 AC 14 ms
10,768 KB
testcase_05 AC 14 ms
11,048 KB
testcase_06 AC 14 ms
10,784 KB
testcase_07 AC 14 ms
10,804 KB
testcase_08 AC 9 ms
8,216 KB
testcase_09 AC 5 ms
7,888 KB
testcase_10 AC 6 ms
7,876 KB
testcase_11 AC 4 ms
7,776 KB
testcase_12 AC 8 ms
8,060 KB
testcase_13 AC 9 ms
8,140 KB
testcase_14 AC 9 ms
8,304 KB
testcase_15 AC 7 ms
8,092 KB
testcase_16 AC 3 ms
5,548 KB
testcase_17 AC 3 ms
5,560 KB
testcase_18 AC 13 ms
10,808 KB
testcase_19 AC 4 ms
7,756 KB
testcase_20 AC 2 ms
5,416 KB
testcase_21 AC 8 ms
8,056 KB
testcase_22 AC 7 ms
7,936 KB
testcase_23 AC 3 ms
5,548 KB
testcase_24 AC 3 ms
5,704 KB
testcase_25 AC 2 ms
5,564 KB
testcase_26 AC 3 ms
5,492 KB
testcase_27 AC 2 ms
5,360 KB
testcase_28 AC 2 ms
5,372 KB
testcase_29 AC 2 ms
5,492 KB
testcase_30 AC 3 ms
5,472 KB
testcase_31 AC 2 ms
5,644 KB
testcase_32 AC 2 ms
5,536 KB
testcase_33 AC 5 ms
9,384 KB
testcase_34 AC 14 ms
17,160 KB
testcase_35 AC 7 ms
10,540 KB
testcase_36 AC 3 ms
8,032 KB
testcase_37 AC 8 ms
10,444 KB
testcase_38 AC 8 ms
10,592 KB
testcase_39 AC 2 ms
5,316 KB
testcase_40 AC 2 ms
5,472 KB
testcase_41 AC 2 ms
5,544 KB
testcase_42 AC 2 ms
5,328 KB
testcase_43 AC 2 ms
5,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

graph g;
ll n,z;
int a[1d5],b[1d5];

ll f(int i,int p){
	ll r=1;
	REP[g.edge[i]](j,g.es[i]){
		ll t=(j!=p?f(j,i):0);
		z+=t*(n-t);
		r+=t;
	}
	return r;
}

{
	rd(n);
	rd((a,b)(n-1));
	g.setEdge(n+1,n-1,a,b);
	f(1,1);
	wt(z*2+n*n);
}
0