結果

問題 No.197 手品
ユーザー Tawara
提出日時 2015-08-28 15:10:19
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 1,000 ms
コード長 322 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-07-20 03:42:21
合計ジャッジ時間 2,011 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

sb = raw_input()
N = input()
sa = raw_input()
bc = sb.count("o")
ac = sa.count("o")
if bc != ac:
	print "SUCCESS"
elif bc == 0 or bc == 3:
	print "FAILURE"
else:
	m = "o" if bc == 1 else "x"
	bi = sb.index(m)
	ai = sa.index(m)
	print "SUCCESS" if (N==0 and ai!=bi) or (N==1 and (ai==bi==1 or abs(ai-bi)==2)) else "FAILURE"
0