結果

問題 No.197 手品
ユーザー JunOnumaJunOnuma
提出日時 2017-05-19 15:00:56
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 6,056 KB
最終ジャッジ日時 2023-09-09 21:17:22
合計ジャッジ時間 2,376 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,856 KB
testcase_01 AC 12 ms
5,972 KB
testcase_02 AC 11 ms
5,980 KB
testcase_03 AC 11 ms
6,012 KB
testcase_04 AC 11 ms
6,048 KB
testcase_05 AC 11 ms
5,884 KB
testcase_06 AC 11 ms
5,868 KB
testcase_07 AC 11 ms
5,972 KB
testcase_08 AC 10 ms
5,876 KB
testcase_09 AC 11 ms
5,860 KB
testcase_10 AC 11 ms
5,956 KB
testcase_11 AC 11 ms
5,944 KB
testcase_12 AC 11 ms
5,940 KB
testcase_13 AC 11 ms
6,008 KB
testcase_14 WA -
testcase_15 AC 11 ms
5,856 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 11 ms
5,932 KB
testcase_19 AC 11 ms
6,056 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 11 ms
6,004 KB
testcase_24 AC 10 ms
5,928 KB
testcase_25 AC 11 ms
6,012 KB
testcase_26 AC 11 ms
6,028 KB
testcase_27 WA -
testcase_28 AC 11 ms
5,952 KB
testcase_29 WA -
testcase_30 AC 12 ms
5,944 KB
testcase_31 AC 11 ms
5,848 KB
testcase_32 AC 11 ms
5,940 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 11 ms
5,956 KB
testcase_36 WA -
testcase_37 AC 11 ms
5,952 KB
testcase_38 AC 11 ms
6,012 KB
testcase_39 WA -
testcase_40 AC 11 ms
6,032 KB
testcase_41 WA -
testcase_42 AC 11 ms
5,956 KB
testcase_43 AC 11 ms
6,052 KB
testcase_44 AC 11 ms
5,928 KB
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def possible(sb, n, sa):
    bo = 0
    for c in sb:
        if c == 'o':
            bo += 1
    ao = 0
    for c in sa:
        if c == 'o':
            ao += 1
    if bo != ao:
        return False
    elif bo == 0 or bo == 3:
        return True
    pb = 0
    for i,c in enumerate(sb):
        if (bo == 1 and c == 'O') or (bo == 2 and c == 'x'):
            pb = i
            break
    pa = 0
    for i,c in enumerate(sa):
        if (bo == 1 and c == 'o') or (bo == 2 and c == 'x'):
            pa = i
            break
    d = abs(pb - pa)
    return (d % 2) == (n % 2)

sb = raw_input()
n = int(raw_input())
sa = raw_input()
if possible(sb, n, sa):
    print 'FAILURE'
else:
    print 'SUCCESS'
0