結果
問題 | No.197 手品 |
ユーザー |
|
提出日時 | 2023-05-18 21:13:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 43 ms / 1,000 ms |
コード長 | 1,212 bytes |
コンパイル時間 | 426 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-16 09:49:58 |
合計ジャッジ時間 | 3,774 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
s = input() n = int(input()) t = input() o_num_s, o_num_t = 0, 0 for i in range(3): if s[i] == 'o': o_num_s += 1 if t[i] == 'o': o_num_t += 1 if o_num_s != o_num_t: print("SUCCESS") elif o_num_s == 3 or o_num_s == 0: print("FAILURE") elif o_num_s == 2: if s[1] == 'x' or t[1] == 'x': if s == t: if n == 1: print("SUCCESS") else: print("FAILURE") else: if n == 0: print("SUCCESS") else: print("FAILURE") else: if s == t: print("FAILURE") else: if n < 2: print("SUCCESS") else: print("FAILURE") else: if s[1] == 'o' or t[1] == 'o': if s == t: if n == 1: print("SUCCESS") else: print("FAILURE") else: if n == 0: print("SUCCESS") else: print("FAILURE") else: if s == t: print("FAILURE") else: if n < 2: print("SUCCESS") else: print("FAILURE")