結果

問題 No.1168 Digit Sum Sequence
ユーザー HoyHoyCharhang
提出日時 2020-08-29 16:35:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 1,548 ms
コンパイル使用メモリ 167,288 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 14:13:18
合計ジャッジ時間 2,521 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,s,n) for (int i = s; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
using field = vector<vector<int>>;

int main() {
  int a;
  cin >> a;
  rep(i,0,100) {
    int b = 0;
    int t = a;
    while (t > 0) {
      b += t % 10;
      t /= 10;
    }
    a = b;
  }
  cout << a << endl;
  return 0;
}
0