結果
| 問題 | No.3140 Weird Parentheses Game |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-05-16 21:52:29 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 24 ms / 2,000 ms |
| + 647µs | |
| コード長 | 309 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 82,544 KB |
| 実行使用メモリ | 55,132 KB |
| 最終ジャッジ日時 | 2026-10-11 01:05:45 |
| 合計ジャッジ時間 | 1,984 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
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