結果

問題 No.2427 Tree Distance Two
ユーザー ramdosramdos
提出日時 2023-08-17 21:06:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,744 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 67,200 KB
最終ジャッジ日時 2024-05-05 03:58:15
合計ジャッジ時間 28,607 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 1,744 ms
63,360 KB
testcase_04 AC 26 ms
10,880 KB
testcase_05 AC 1,732 ms
63,488 KB
testcase_06 AC 26 ms
10,624 KB
testcase_07 AC 1,576 ms
67,200 KB
testcase_08 AC 1,734 ms
66,560 KB
testcase_09 AC 1,627 ms
65,408 KB
testcase_10 AC 1,703 ms
66,432 KB
testcase_11 AC 1,615 ms
66,688 KB
testcase_12 AC 1,700 ms
65,920 KB
testcase_13 AC 1,728 ms
65,280 KB
testcase_14 AC 1,331 ms
62,720 KB
testcase_15 AC 25 ms
10,880 KB
testcase_16 AC 25 ms
10,624 KB
testcase_17 AC 25 ms
10,880 KB
testcase_18 AC 25 ms
10,752 KB
testcase_19 AC 25 ms
10,624 KB
testcase_20 AC 61 ms
12,288 KB
testcase_21 AC 67 ms
12,416 KB
testcase_22 AC 37 ms
11,264 KB
testcase_23 AC 31 ms
11,008 KB
testcase_24 AC 64 ms
12,288 KB
testcase_25 AC 435 ms
24,704 KB
testcase_26 AC 1,053 ms
43,392 KB
testcase_27 AC 739 ms
34,176 KB
testcase_28 AC 1,582 ms
59,520 KB
testcase_29 AC 1,401 ms
53,632 KB
testcase_30 AC 1,015 ms
42,496 KB
testcase_31 AC 652 ms
31,360 KB
testcase_32 AC 992 ms
42,112 KB
testcase_33 AC 891 ms
38,784 KB
testcase_34 AC 271 ms
19,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
V=[[] for i in range(N+1)]
for i in range(N-1):
    a,b=map(int,input().split())
    V[a].append(b)
    V[b].append(a)
C=[len(t)-1 for t in V]
for i in range(1,N+1):
    print(sum([C[t] for t in V[i]]))
0