結果

問題 No.656 ゴルフ
ユーザー tapioka324
提出日時 2020-07-20 22:51:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 1,661 ms
コンパイル使用メモリ 167,376 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 17:58:45
合計ジャッジ時間 2,313 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define rep(i, a, n) for (int i = a; i < n; ++i)

int main() {
    string s;
    cin >> s;

    int ans = 0;
    rep(i, 0, s.length()) {
        int cnt = s[i] - '0';
        if (cnt == 0) ans += 10;
        else ans += cnt;
    }
    cout << ans << endl;
    return 0;
}
0