結果

問題 No.3171 Color Restoration
コンテスト
ユーザー timi
提出日時 2025-06-06 21:26:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 69 ms / 2,000 ms
+ 482µs
コード長 432 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 225 ms
コンパイル使用メモリ 95,724 KB
実行使用メモリ 82,304 KB
最終ジャッジ日時 2026-07-11 06:07:41
合計ジャッジ時間 3,908 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S=['gray','brown','green','cyan','blue','yellow','orange','red']
T=['gray','green','blue','yellow','red']
U=['gray','green','cyan','blue','violet','orange','red']

a,b,c=input().split()
B=sorted([a,b,c])
B=tuple(B)
D={}
for s in S:
  for t in T:
    for u in U:
      A=sorted([s,t,u])
      A=tuple(A)
      if A not in D:
        D[A]=0
      D[A]+=1 

if B not in D:
  print('No')
elif D[B]==1:
  print('Yes')
else:
  print('No')
0