結果

問題 No.3140 Weird Parentheses Game
ユーザー SUPERARMOR
提出日時 2025-06-19 12:22:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-06-19 12:22:43
合計ジャッジ時間 2,574 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

def removable_idx(N, S):
	for i in range(N-1):
		if S[i] == '(' and S[i+1] == ')':
			return i
	return -1


N = int(input())
S = list(input())

First = False

while True:
	idx = removable_idx(N, S)
	if idx == -1:
		break
	
	del S[idx+1]
	del S[idx]
	N -= 2
	First = not First

print('First') if First else print('Second')
0