結果
問題 | No.3015 右に寄せろ! |
ユーザー |
|
提出日時 | 2025-01-25 12:32:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 270 bytes |
コンパイル時間 | 919 ms |
コンパイル使用メモリ | 62,568 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-01-25 22:03:02 |
合計ジャッジ時間 | 1,829 ms |
ジャッジサーバーID (参考情報) |
judge10 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
#include<iostream>#include<cassert>using namespace std;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);string S;cin>>S;long ans=0;int cnt=0;for(char c:S){if(c=='0'){ans+=cnt/2;cnt=cnt/2*2;}else cnt++;}cout<<ans<<endl;}