結果
| 問題 | No.3015 右に寄せろ! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-02 13:45:02 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 370 bytes |
| 記録 | |
| コンパイル時間 | 8,150 ms |
| コンパイル使用メモリ | 333,240 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2026-01-02 14:31:00 |
| 合計ジャッジ時間 | 4,589 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main () {
string s;
cin >> s;
int ans = 0;
int one_count = 0;
for(int i = 0; i < s.size(); i++){
if(s[i] == '1'){
if(one_count > 0){
one_count++;
} else if(s[i + 1] == '1') {
one_count++;
}
} else {
ans += one_count / 2;
}
}
cout << ans << endl;
}