結果
| 問題 | No.3171 Color Restoration |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2025-06-06 21:39:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 685 bytes |
| 記録 | |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 82,900 KB |
| 実行使用メモリ | 54,020 KB |
| 最終ジャッジ日時 | 2025-06-06 21:39:09 |
| 合計ジャッジ時間 | 2,400 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 3 |
ソースコード
s1,s2,s3 = map(str, input().split())
s = [s1,s2,s3]
if len(set(s)) == 1:
print("Yes")
exit()
a=[{"gray","brown","green","cyan","blue","yellow","orange","red"},
{"gray","green","blue","yellow","red"},
{"gray","green","cyan","blue","violet","orange","red"}]
while len(a) > 0:
b = False
for si in s:
c = 0
for ai in a:
if si in ai:
c += 1
if c==s.count(si):
for ai in a:
if si in ai:
s.remove(si)
a.remove(ai)
b = True
break
if not b:
break
if len(a) == 0 or len(set(s)) == 1:
print("Yes")
else:
print("No")
nikoro256