結果
| 問題 | No.806 木を道に |
| コンテスト | |
| ユーザー |
maburoe
|
| 提出日時 | 2019-05-17 15:36:22 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 283 ms / 2,000 ms |
| + 526µs | |
| コード長 | 425 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 21,416 KB |
| 実行使用メモリ | 16,632 KB |
| 最終ジャッジ日時 | 2026-08-29 08:09:30 |
| 合計ジャッジ時間 | 7,173 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
node_num = int(input())
nodes_count = [0] * node_num
answer = 0
for i in range(node_num - 1):
first, second = map(int, input().split())
firstIndex = first - 1
secondIndex = second - 1
if nodes_count[firstIndex] == 2:
answer += 1
else:
nodes_count[firstIndex] += 1
if nodes_count[secondIndex] == 2:
answer += 1
else:
nodes_count[secondIndex] += 1
print(answer)
maburoe