結果

問題 No.3171 Color Restoration
ユーザー tassei903
提出日時 2025-06-06 21:32:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 785 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2025-06-06 21:32:14
合計ジャッジ時間 2,714 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
c = [["gray","brown","green","cyan","blue","yellow","orange","red"],
["gray","green","blue","yellow","red"],
["gray","green","cyan","blue","violet","orange","red"]]
s = input().split()

from itertools import permutations

n = 3
ans = set()
for p in permutations(range(n), n):
    if all(s[p[i]] in c[i] for i in range(n)):
        ans.add(tuple([s[p[i]] for i in range(n)]))

# print(ans)
if len(ans) == 1:
    Yes()
else:
    No()
0