結果

問題 No.197 手品
ユーザー Hachimori
提出日時 2015-04-29 00:07:59
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 559 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 07:38:03
合計ジャッジ時間 1,727 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
#coding:utf8

def read():
    return list(raw_input()), input(), list(raw_input())


def work((S, N, T)):
    if S.count('o') != T.count('o') or S.count('x') != T.count('x'):
        print "SUCCESS"
        return

    cost = 0
    for i in range(len(S)):
        for j in range(i + 1, len(S)):
            if S[i] != T[i] and S[j] != T[j]:
                cost = abs(i - j)

    if cost > N or (S == T and N == 1 and S[0] == S[2]):
        print "SUCCESS"
    else:
        print "FAILURE"


if __name__ == "__main__":
    work(read())
0