結果

問題 No.2427 Tree Distance Two
ユーザー 👑 timitimi
提出日時 2023-08-18 21:30:01
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 370 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 199,680 KB
最終ジャッジ日時 2024-05-06 03:21:26
合計ジャッジ時間 8,162 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
57,216 KB
testcase_01 AC 41 ms
51,840 KB
testcase_02 AC 41 ms
51,840 KB
testcase_03 AC 1,600 ms
193,920 KB
testcase_04 AC 42 ms
51,968 KB
testcase_05 AC 1,580 ms
194,304 KB
testcase_06 AC 41 ms
51,584 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

##N,K=map(int, input().split())
#A=list(map(int, input().split()))
N=int(input())
D=[[]for _ in range(N)]
E=[set() for _ in range(N)]
for i in range(N-1):
  u,v=map(int, input().split())
  u-=1;v-=1
  D[u].append(v);D[v].append(u)
  E[u].add(v);E[v].add(u)

ans=[]
for i in range(N):
  C=set()
  for now in D[i]:
    for nex in D[now]:
      C.add(nex)
  print(len(C)-1)
0