結果

問題 No.1207 グラフX
ユーザー tailstails
提出日時 2020-08-30 16:04:40
言語 cLay
(20231016-1)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 3,763 ms
コンパイル使用メモリ 174,532 KB
実行使用メモリ 18,528 KB
最終ジャッジ日時 2023-09-19 01:04:04
合計ジャッジ時間 14,903 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
18,248 KB
testcase_01 AC 69 ms
18,264 KB
testcase_02 AC 66 ms
18,252 KB
testcase_03 AC 67 ms
18,280 KB
testcase_04 AC 66 ms
18,232 KB
testcase_05 AC 68 ms
18,232 KB
testcase_06 AC 69 ms
18,268 KB
testcase_07 AC 68 ms
18,240 KB
testcase_08 AC 47 ms
15,628 KB
testcase_09 AC 54 ms
15,856 KB
testcase_10 AC 69 ms
18,236 KB
testcase_11 AC 69 ms
18,416 KB
testcase_12 AC 50 ms
15,692 KB
testcase_13 AC 21 ms
10,472 KB
testcase_14 AC 65 ms
18,260 KB
testcase_15 AC 54 ms
15,852 KB
testcase_16 AC 22 ms
10,572 KB
testcase_17 AC 41 ms
15,472 KB
testcase_18 AC 37 ms
15,808 KB
testcase_19 AC 33 ms
12,952 KB
testcase_20 AC 66 ms
18,392 KB
testcase_21 AC 5 ms
9,852 KB
testcase_22 AC 41 ms
15,508 KB
testcase_23 AC 46 ms
15,684 KB
testcase_24 AC 33 ms
13,284 KB
testcase_25 AC 65 ms
18,316 KB
testcase_26 AC 49 ms
15,808 KB
testcase_27 AC 59 ms
18,052 KB
testcase_28 AC 56 ms
15,876 KB
testcase_29 AC 58 ms
18,056 KB
testcase_30 AC 27 ms
13,016 KB
testcase_31 AC 17 ms
10,340 KB
testcase_32 AC 26 ms
13,028 KB
testcase_33 AC 26 ms
13,116 KB
testcase_34 AC 53 ms
15,892 KB
testcase_35 AC 5 ms
9,780 KB
testcase_36 AC 54 ms
15,964 KB
testcase_37 AC 44 ms
15,852 KB
testcase_38 AC 13 ms
10,520 KB
testcase_39 AC 28 ms
13,032 KB
testcase_40 AC 11 ms
10,188 KB
testcase_41 AC 32 ms
12,972 KB
testcase_42 AC 3 ms
9,452 KB
testcase_43 AC 2 ms
9,484 KB
testcase_44 AC 3 ms
9,432 KB
testcase_45 AC 66 ms
18,528 KB
testcase_46 AC 67 ms
18,248 KB
testcase_47 AC 64 ms
18,292 KB
testcase_48 AC 63 ms
18,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int n,m,x,y,z,t;
int e1[2d5],e2[2d5],ez[2d5],en;
int s[2d5];
unionFind u;
graph g;
Mint b,r;
{
	rd(n,m,b);
	u.walloc(n,1);
	rep(m){
		rd(x--,y--,z);
		if(u(x,y))e1[en]=x,e2[en]=y,ez[en]=z,++en;
	}
	g.setEdge(n,en,e1,e2);
	g.SubTreeSize(0,s);
	rep(i,en){
		t=min(s[e1[i]],s[e2[i]]);
		r+=b**ez[i]*t*(n-t);
	}
	wt(r);
}
0