結果

問題 No.3140 Weird Parentheses Game
ユーザー timi
提出日時 2025-05-16 21:25:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 82,568 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2025-06-19 15:29:52
合計ジャッジ時間 2,067 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
d=deque()

N=int(input())
A=[]
S=input()
c=0
for s in S:
  d.append(s)
  if s=='(':
    c+=1 
  else:
    c-=1 
  if c==0:
    A.append(len(d)//2)
    d=deque()

c=0
for a in A:
  c^=a 
  
if c!=0:
  print('First')
else:
  print('Second')
0