結果

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

ソースコード

diff #

start = input()
n = int(input())
end = input()

ans = "SUCCESS"

move_list = [ ["012"], ["102","021"], ["120","201"], ["210"] ]
movable_list = []
if start.count("o") != end.count("o"):
	 print(ans)
else: 
	if start.count("o") in [3,0]:
		ans = "FAILURE"
		print(ans)
	else:
		for i in range(4):
			for j in move_list[i]:
				if "".join([ start[int(j[k])] for k in range(3) ]) == end:
					movable_list.append(i)

		suc = 0
		for i in movable_list:
			if n >= i and (n-i) % 2 == 0:
				suc = 1
		if suc == 1:
			ans = "FAILURE"
		print(ans)

0