結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-11 23:04:20 |
| 言語 | Python2 (2.7.18) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 360 bytes |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 7,068 KB |
| 実行使用メモリ | 815,156 KB |
| 最終ジャッジ日時 | 2024-09-25 01:12:50 |
| 合計ジャッジ時間 | 3,389 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 1 -- * 2 |
| other | AC * 1 -- * 28 |
ソースコード
import itertools
N = input()
LIST = []
for i in range(N):
LIST.append(raw_input())
BBB = [i for i in itertools.permutations(LIST)]
for i in range(len(BBB)):
CCC = BBB[i]
OK = 1
DDD = CCC[0]
for j in range(N-1):
if CCC[j+1] == DDD:
OK = 0
break
DDD = CCC[j+1]
if OK == 1:
print "YES"
break
if OK == 0:
print "NO"