結果

問題 No.763 Noelちゃんと木遊び
ユーザー %20%20
提出日時 2018-12-11 03:33:40
言語 cLay
(20240104-1)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 1,724 ms
コンパイル使用メモリ 162,220 KB
実行使用メモリ 19,460 KB
最終ジャッジ日時 2023-09-19 00:13:49
合計ジャッジ時間 3,376 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
19,460 KB
testcase_01 AC 14 ms
12,776 KB
testcase_02 AC 29 ms
14,400 KB
testcase_03 AC 20 ms
13,692 KB
testcase_04 AC 15 ms
13,036 KB
testcase_05 AC 20 ms
13,636 KB
testcase_06 AC 35 ms
15,140 KB
testcase_07 AC 35 ms
15,020 KB
testcase_08 AC 21 ms
13,784 KB
testcase_09 AC 15 ms
13,056 KB
testcase_10 AC 9 ms
12,076 KB
testcase_11 AC 38 ms
15,204 KB
testcase_12 AC 31 ms
14,832 KB
testcase_13 AC 33 ms
14,744 KB
testcase_14 AC 28 ms
14,292 KB
testcase_15 AC 20 ms
13,496 KB
testcase_16 AC 7 ms
11,868 KB
testcase_17 AC 20 ms
13,548 KB
testcase_18 AC 36 ms
15,204 KB
testcase_19 AC 31 ms
14,808 KB
testcase_20 AC 33 ms
14,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll n,r,u[2d5];
vector<ll>v[2d5];
ll f(ll j,ll p){
	ll a=1,x;
	rep(i,v[j].size())a&=(x=v[j][i])-p?f(x,j):1;
	r+=a;
	return!a;
}

{
	rd(n,u(n*2-2));
	rep(i,n*2-2)v[u[i]].push_back(u[i^1]);
	f(1,1);
	wt(r);
}
0