結果

問題 No.1070 Missing a space
ユーザー Tsukasan_z46
提出日時 2020-06-06 00:06:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 556 bytes
コンパイル時間 1,918 ms
コンパイル使用メモリ 192,420 KB
最終ジャッジ日時 2025-01-10 23:06:18
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPLL(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string S; cin >> S;
  int N = S.size();
  int ans = 0;
  for(int i = 1; i < N; i++){
    if(S[i] != '0') ans++;
  }
  cout << ans << endl;
}
0