結果
| 問題 |
No.3015 右に寄せろ!
|
| コンテスト | |
| ユーザー |
Cafe1942
|
| 提出日時 | 2025-01-25 14:12:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 927 bytes |
| コンパイル時間 | 674 ms |
| コンパイル使用メモリ | 89,320 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-01-25 23:10:47 |
| 合計ジャッジ時間 | 2,123 ms |
|
ジャッジサーバーID (参考情報) |
judge9 / judge10 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 WA * 11 |
ソースコード
#include <iostream>
#include <iomanip>//小数点出力用
//cout << fixed << setprecision(10) << ans;
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
using ll = long long;
using namespace std;
#define modP 998244353
bool chkrng0idx(int pos, int sup) { return (0 <= pos && pos < sup); }
int clk4(int num) { return (num - 2) * (num % 2); }
void yn(bool tf) { cout << (tf ? "Yes\n" : "No\n"); }
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string S;cin >> S;
int ans = 0;
int point = 0;
int combo1 = 0;
for (int i = S.size() - 1;i >= 0;i--) {
if (S[i] == '0') {
point++;
combo1 = 0;
}
else {
combo1++;
if (combo1 == 2) {
ans += point;
combo1 = 0;
}
}
}
cout << ans;
return 0;
}
Cafe1942