結果
問題 |
No.3171 Color Restoration
|
ユーザー |
|
提出日時 | 2025-06-06 23:14:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,162 bytes |
コンパイル時間 | 584 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-06-06 23:14:31 |
合計ジャッジ時間 | 2,749 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 12 |
ソースコード
import sys def main(): # sys.setrecursionlimit(100000) input = lambda: sys.stdin.readline()[:-1] S1, S2, S3 = input().split() one = {"gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red"} two = {"gray", "green", "blue", "yellow", "red"} three = {"gray", "green", "cyan", "blue", "violet", "orange", "red"} if S1 == S2 == S3: print("Yes") return arr1 = [[0] * 3 for _ in [0] * 3] for i, s in enumerate((S1, S2, S3)): if s in one: arr1[i][0] = 1 if s in two: arr1[i][1] = 1 if s in three: arr1[i][2] = 1 for i, a in enumerate(arr1): if sum(a) == 1: for j in {0, 1, 2} ^ {i}: for k in range(3): if arr1[i][k] == arr1[j][k] == 1: arr1[j][k] = 0 n = 0 for a in arr1: if sum(a) == 1: n += 1 if not n: print("No") elif n > 1: print("Yes") if not __debug__: f = open(sys.argv[1], "r") sys.stdin = f # try: # sys.set_int_max_str_digits(100000) # except AttributeError: # pass main()