結果
| 問題 | No.2888 Mamehinata |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-13 21:29:36 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 272 bytes |
| 記録 | |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 96,364 KB |
| 実行使用メモリ | 91,520 KB |
| 最終ジャッジ日時 | 2026-08-26 13:06:17 |
| 合計ジャッジ時間 | 6,246 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 1 -- * 41 |
ソースコード
n,m=map(int,input().split())
a=[[]for i in range(n)]
for i in range(m):
s,t=map(int,input().split())
a[s-1].append(t-1)
a[t-1].append(s-1)
now={0}
for _ in range(n):
new=set()
for i in now:
for j in a[i]:
if j not in now:
new.add(j)
now=new
print(len(now))