結果
問題 |
No.408 五輪ピック
|
ユーザー |
![]() |
提出日時 | 2017-07-30 23:26:12 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 488 bytes |
コンパイル時間 | 303 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 16,512 KB |
最終ジャッジ日時 | 2024-10-10 22:42:25 |
合計ジャッジ時間 | 13,353 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 WA * 1 TLE * 1 -- * 4 |
ソースコード
N, M = map(int, raw_input().split()) rinsetsu = [[] for _ in xrange(N)] for _ in xrange(M): a, b = map(int, raw_input().split()) rinsetsu[a-1].append(b-1) rinsetsu[b-1].append(a-1) v2v3 = [(u, v) for u in rinsetsu[0] for v in rinsetsu[u] if v != 0] for i in xrange(len(v2v3)): for j in xrange(i+1, len(v2v3)): v2, v3 = v2v3[i] v5, v4 = v2v3[j] if v2 != v5 and v3 != v4 and v3 in rinsetsu[v4]: print 'YES' exit() print 'NO'