結果
問題 |
No.408 五輪ピック
|
ユーザー |
|
提出日時 | 2016-10-07 11:42:09 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 487 bytes |
コンパイル時間 | 194 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 17,696 KB |
最終ジャッジ日時 | 2024-11-21 19:06:44 |
合計ジャッジ時間 | 24,455 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 WA * 3 TLE * 3 |
ソースコード
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'