結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2016-05-31 02:19:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 1,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-20 03:48:37 |
合計ジャッジ時間 | 2,365 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
S1 = input() N = int(input()) S2 = input() def coin_magic(n,s1,s2): a, b, c = list(s1) if n == 0: return 'FAILURE' if s2 == s1 else 'SUCCESS' if n == 1: one = [''.join([b, a, c]), ''.join([a, c, b])] return 'FAILURE' if s2 in one else 'SUCCESS' else: if s1.count('o') == s2.count('o'): return 'FAILURE' else: return 'SUCCESS' print(coin_magic(N, S1, S2))