結果

問題 No.197 手品
ユーザー rpy3cpp
提出日時 2015-04-28 23:50:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-27 07:20:01
合計ジャッジ時間 2,669 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

s2p = {'oox': 2, 'oxo': 1, 'xoo': 0,
       'xxo': 2, 'xox': 1, 'oxx': 0}

def solve(s_before, N, s_after):
    if s_before.count('o') != s_after.count('o'):
        return 'SUCCESS'
    if s_before.count('o') == 0 or s_before.count('o') == 3:
        return 'FAILURE'
    p0 = s2p[s_before]
    p1 = s2p[s_after]
    if N == 1:
        if abs(p0 - p1) == 2 or (p0 == p1 == 1):
            return 'SUCCESS'
    return 'FAILURE'

s_before = input()
N = int(input())
s_after = input()

print(solve(s_before, N, s_after))
0