結果

問題 No.197 手品
コンテスト
ユーザー Hachimori
提出日時 2015-04-29 00:07:59
言語 PyPy2
(7.3.20)
結果
WA  
実行時間 -
コード長 559 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 134 ms
コンパイル使用メモリ 77,472 KB
最終ジャッジ日時 2025-12-03 14:51:53
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/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