結果
| 問題 |
No.3114 0→1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-19 11:23:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 328 bytes |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 11,904 KB |
| 実行使用メモリ | 10,112 KB |
| 最終ジャッジ日時 | 2025-04-19 11:23:23 |
| 合計ジャッジ時間 | 2,497 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 30 |
ソースコード
def min_operations_to_good_string(s: str) -> int:
zeros = 0
ones = 0
res = 0
for c in s:
if c == '0':
zeros += 1
else:
ones += 1
if zeros > ones:
res += 1
zeros -= 1 # 0 を 1 に変えたとみなす
ones += 1
return res