結果

問題 No.197 手品
ユーザー cherrypi59
提出日時 2018-06-22 23:06:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 884 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-20 03:54:41
合計ジャッジ時間 2,482 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    sb, n, sa = input(), int(input()), input()

    if sb.count("o") != sa.count("o"):
        print("SUCCESS")
    elif sb.count("o") == 3 or sa.count("x") == 3:
        print("FAILURE")
    elif n > 1:
        print("FAILURE")
    elif n == 0:
        if sb == sa:
            print("FAILURE")
        else:
            print("SUCCESS")
    else:
        if sb.count("o") == 1:
            if sb[1] == "o" and sa[1] == "o":
                print("SUCCESS")
            elif abs(sb.index("o")-sa.index("o")) == 2:
                print("SUCCESS")
            else:
                print("FAILURE")
        else:
            if sb[1] == "x" and sa[1] == "x":
                print("SUCCESS")
            elif abs(sb.index("x")-sa.index("x")) == 2:
                print("SUCCESS")
            else:
                print("FAILURE")


if __name__ == '__main__':
    main()
0