結果
| 問題 |
No.806 木を道に
|
| コンテスト | |
| ユーザー |
oshibori
|
| 提出日時 | 2019-03-22 21:50:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 103 ms / 2,000 ms |
| コード長 | 183 bytes |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 82,368 KB |
| 実行使用メモリ | 77,312 KB |
| 最終ジャッジ日時 | 2024-09-19 04:06:50 |
| 合計ジャッジ時間 | 3,085 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
n=int(input())
ans=0
deg=[0]*n
for i in range(n-1):
a,b=map(int,input().split())
deg[a-1]+=1
deg[b-1]+=1
for i in range(n):
ans+=max(0,deg[i]-2)
print(ans)
oshibori