結果
| 問題 | No.3140 Weird Parentheses Game |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-16 21:52:29 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 2,000 ms |
| + 766µs | |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 79,244 KB |
| 最終ジャッジ日時 | 2026-07-20 22:35:16 |
| 合計ジャッジ時間 | 3,585 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
N = int(input())
S = input()
def is_balanced(s: str) -> bool:
d = 0
for c in S:
if c == '(':
d += 1
elif c == ')':
if d == 0:
return False
d -= 1
return d == 0
if is_balanced(S):
print('First')
else:
print('Second')
norioc