結果
問題 |
No.408 五輪ピック
|
ユーザー |
|
提出日時 | 2016-10-07 11:43:02 |
言語 | PyPy2 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 487 bytes |
コンパイル時間 | 2,187 ms |
コンパイル使用メモリ | 76,800 KB |
実行使用メモリ | 157,824 KB |
最終ジャッジ日時 | 2024-11-21 19:07:10 |
合計ジャッジ時間 | 25,483 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 1 TLE * 3 MLE * 21 |
ソースコード
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'