結果

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

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
# †
# (ΦωΦ)<
# テクに走らず読みやすいコードを書く

def f(s0, s1, c):
    if s0[0] == c and s1[2] == c:
        return 1
    if s0[2] == c and s1[0] == c:
        return 1
    return 0

def fushigi(s0, s1, n):
    s0o = s0.count('o')
    s1o = s1.count('o')
    if s0o != s1o:
        return 1 # コインの数が違ってたらふしぎ!
    if n == 0:
        return s0 != s1 # なんもしてないのに違ってたらふしぎ!
    if n == 1:
        if s0o == 1:
            if f(s0, s1, 'o'):
                return 1
        elif s0o == 2:
            if f(s0, s1, 'x'):
                return 1
    return 0

s0 = raw_input()
n = int(raw_input())
s1 = raw_input()
if fushigi(s0, s1, n):
    print 'SUCCESS'
else:
    print 'FAILURE'
0