結果
| 問題 | No.3140 Weird Parentheses Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-16 21:24:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 273 bytes |
| 記録 | |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 82,756 KB |
| 実行使用メモリ | 55,532 KB |
| 最終ジャッジ日時 | 2025-05-16 21:24:21 |
| 合計ジャッジ時間 | 2,191 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 12 |
ソースコード
from collections import deque
N = int(input())
S = input()
q = deque()
cnt = 0
for s in S:
if q:
if q[-1] == "(" and s == ")":
q.pop()
cnt += 1
continue
q.append(s)
ans = "First" if cnt % 2 != 0 else "Second"
print(ans)