結果
問題 |
No.3015 右に寄せろ!
|
ユーザー |
![]() |
提出日時 | 2025-01-31 22:35:12 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 314 bytes |
コンパイル時間 | 2,252 ms |
コンパイル使用メモリ | 193,828 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-31 22:35:16 |
合計ジャッジ時間 | 3,980 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 WA * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); string s; cin >> s; int ans = 0; int i = 0; for (char c : s) { if (c == '1') { i++; } else { ans += i / 2; i -= i % 2; } } cout << ans << endl; }