結果
| 問題 |
No.2888 Mamehinata
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-09-13 21:37:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 553 bytes |
| コンパイル時間 | 131 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 59,392 KB |
| 最終ジャッジ日時 | 2024-09-13 21:38:27 |
| 合計ジャッジ時間 | 27,431 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 45 WA * 7 |
ソースコード
import sys
input = sys.stdin.readline
from collections import deque
N,M=map(int,input().split())
E=[[] for i in range(N)]
for i in range(M):
x,y=map(int,input().split())
x-=1
y-=1
E[x].append(y)
E[y].append(x)
Q=deque()
Q.append(0)
DIS=[1<<30]*N
DIS[0]=0
while Q:
x=Q.popleft()
for to in E[x]:
if DIS[to]>DIS[x]+1:
DIS[to]=DIS[x]+1
Q.append(to)
ANS=[0]*(N+1)
for d in DIS:
if d<N+1:
ANS[d]+=1
for i in range(2,N+1):
ANS[i]+=ANS[i-2]
for ans in ANS[1:]:
print(ans)
titia