結果
| 問題 |
No.3114 0→1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-20 14:04:35 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 175 bytes |
| コンパイル時間 | 597 ms |
| コンパイル使用メモリ | 11,776 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2025-04-20 14:04:39 |
| 合計ジャッジ時間 | 3,618 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 30 |
ソースコード
n = int(input())
s = input()
balance = 0
ans = 0
for c in s:
if c == '0':
balance += 1
else:
if balance > 0:
balance -= 1
print(balance)