結果

問題 No.1070 Missing a space
ユーザー flamestorm
提出日時 2020-06-24 09:58:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 730 bytes
コンパイル時間 910 ms
コンパイル使用メモリ 101,056 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 20:02:06
合計ジャッジ時間 1,453 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

const int MAX = 200007;
const int MOD = 1000000007;

void solve() {
    string s;
    cin >> s;
    long long res = 0;
    for (char c : s) {
        if (c != '0') {res++;}
    }
    cout << res - 1;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //int tt; cin >> tt; for (int i = 1; i <= tt; i++) {solve(); cout << endl;}
    solve();
}
0