結果

問題 No.1928 Make a Binary Tree
ユーザー tailstails
提出日時 2022-05-06 22:01:26
言語 cLay
(20240104-1)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 2,627 ms
コンパイル使用メモリ 178,028 KB
実行使用メモリ 34,928 KB
最終ジャッジ日時 2023-09-20 02:55:06
合計ジャッジ時間 7,019 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,380 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 3 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 39 ms
13,328 KB
testcase_36 WA -
testcase_37 AC 37 ms
13,000 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 55 ms
34,928 KB
testcase_50 AC 70 ms
13,100 KB
testcase_51 AC 59 ms
13,192 KB
testcase_52 AC 58 ms
12,984 KB
testcase_53 AC 59 ms
12,996 KB
testcase_54 AC 57 ms
13,060 KB
testcase_55 AC 49 ms
27,204 KB
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 57 ms
17,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

graph g;
pair<ll,ll> f(ll i,ll p){
	vector<ll> v;
	rep[g.edge[i]](j,g.es[i]){
		if(j!=p){
			auto r=f(j,i);
			v.push_back(r.first);
			v.push_back(r.second);
		}
	}
	sort(v.begin(),v.end());
	v.push_back(0);
	v.push_back(0);
	v.push_back(0);
	return {v[0]+v[1]-1,v[2]};
}
{
	ll@n;
	int a[n],b[];
	rd((a,b)(n-1));
	g.setEdge(n+1,n-1,a,b);
	auto r=f(1,1);
	wt(-r.first);
}
0