結果
| 問題 | 
                            No.197 手品
                             | 
                    
| コンテスト | |
| ユーザー | 
                             🍡yurahuna
                         | 
                    
| 提出日時 | 2016-07-19 14:44:47 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 480 bytes | 
| コンパイル時間 | 114 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-06-27 13:33:53 | 
| 合計ジャッジ時間 | 2,731 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 42 WA * 1 | 
ソースコード
def possible(s, t, n):
    if s.count('o') != t.count('o'):
        return False
    if s.count('o') > 1:
        s = s.translate(str.maketrans('ox', 'xo'))
        t = t.translate(str.maketrans('ox', 'xo'))
    if s.count('o') == 0:
        return s == t
    # s.count('o') == 1
    if n == 1:
        return not (s[1] == t[1] == 'o' or s == t[::-1])
    else:
        return True
s = input()
n = int(input())
t = input()
print('FAILURE' if possible(s, t, n) else 'SUCCESS')
            
            
            
        
            
🍡yurahuna