結果

問題 No.3015 右に寄せろ!
ユーザー ei2326
提出日時 2025-02-10 17:57:43
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 3,196 ms
コンパイル使用メモリ 274,404 KB
実行使用メモリ 7,588 KB
最終ジャッジ日時 2025-02-10 17:57:48
合計ジャッジ時間 4,405 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int inf = 2000000000000000000;
signed main(){
    string s;cin>>s;
    int ans=0;
    int c=0;
    int k=0;
    for(int i=0;i<s.size();i++){
        if(i!=s.size()-1 &&  s[i]=='1'&&s[i+1]=='1'){
            k++;
        }else if(s[i]=='0'){
            ans+=k;
        }else{
            k=0;
        }
    }
    cout<<ans<<"\n";
}
0