結果
問題 |
No.2780 The Bottle Imp
|
ユーザー |
|
提出日時 | 2024-06-07 23:17:40 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 241 bytes |
コンパイル時間 | 406 ms |
コンパイル使用メモリ | 82,252 KB |
実行使用メモリ | 88,168 KB |
最終ジャッジ日時 | 2024-12-27 14:33:01 |
合計ジャッジ時間 | 6,576 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 36 WA * 4 |
ソースコード
n=int(input()) d=[] for i in range(n): m,*a=map(int,input().split()) d+=[i-1 for i in a], q=[0] s=[0]*n s[0]=1 while q: p=q.pop() for v in d[p]: if s[v]<1: s[v]=1 q+=v, if sum(s)==n: print('Yes') else: print('No')