結果
| 問題 |
No.2427 Tree Distance Two
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-06-01 20:15:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 238 bytes |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 64,128 KB |
| 最終ジャッジ日時 | 2024-12-22 09:08:22 |
| 合計ジャッジ時間 | 41,132 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 TLE * 10 |
ソースコード
N=int(input())
graph=[[] for x in range(N)]
for i in range(N-1):
u,v=map(int,input().split())
u-=1;v-=1
graph[u].append(v)
graph[v].append(u)
for x in range(N):
ans=sum(len(graph[y])-1 for y in graph[x])
print(ans)
vwxyz