結果
| 問題 |
No.3114 0→1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-30 16:01:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 400 bytes |
| コンパイル時間 | 521 ms |
| コンパイル使用メモリ | 12,160 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2025-04-30 16:02:01 |
| 合計ジャッジ時間 | 2,613 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 30 |
ソースコード
def min_operations(n, s):
operations = 0
zero_count = 0
for char in s:
if char == '0':
zero_count += 1
else: # char == '1'
zero_count -= 1
# もし0の数が1の数を超えたら、その超過分だけ操作が必要
if zero_count > 0:
operations = max(operations, zero_count)
return operations