結果

問題 No.656 ゴルフ
ユーザー cumin
提出日時 2020-03-28 17:52:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 1,475 ms
コンパイル使用メモリ 161,748 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 11:55:21
合計ジャッジ時間 2,146 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const ll INF=1e18;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  string s;
  cin >> s;
  int n=s.size();
  int ans=0;
  rep(i,n){
    if(s[i]-'0'==0)ans+=10;
    else ans+=s[i]-'0';
  }
  cout << ans << endl;
}
0