結果

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

ソースコード

diff #

from collections import Counter

a = ['gray','brown','green','cyan','blue','yellow','orange','red']
b = ['gray','green','blue','yellow','red']
c = ['gray','green','cyan','blue','violet','orange','red']

S1, S2, S3 = input().split()


def solve():
    freq = Counter()
    for x in a:
        for y in b:
            for z in c:
                t = tuple(sorted([x, y, z]))
                freq[t] += 1

    ss = tuple(sorted([S1, S2, S3]))
    return freq[ss] == 1


if solve():
    print('Yes')
else:
    print('No')
0