結果
| 問題 |
No.3171 Color Restoration
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-06-06 21:54:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 393 bytes |
| コンパイル時間 | 1,034 ms |
| コンパイル使用メモリ | 81,636 KB |
| 実行使用メモリ | 52,816 KB |
| 最終ジャッジ日時 | 2025-06-06 21:54:47 |
| 合計ジャッジ時間 | 2,404 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
from itertools import permutations
coders = [
["gray","brown","green","cyan","blue","yellow","orange","red"],
["gray","green","blue","yellow","red"],
["gray","green","cyan","blue","violet","orange","red"]
]
S = input().split()
cnt = 0
for perm in set(permutations(S)):
if all(s in coders[i] for i, s in enumerate(perm)):
cnt += 1
print("Yes" if cnt == 1 else "No")