結果

問題 No.656 ゴルフ
ユーザー 0x19f
提出日時 2018-03-02 22:23:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 165,900 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-13 03:07:09
合計ジャッジ時間 2,067 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

int main(void) {
  string S;
  cin >> S;

  ll ans = 0;
  REP(i, 0, S.length()) {
    ll x = S[i] - '0';
    if(x == 0) ans += 10;
    else ans += x;
  }
  cout << ans << endl;
}
0