結果
問題 |
No.1168 Digit Sum Sequence
|
ユーザー |
|
提出日時 | 2020-10-11 15:14:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 332 bytes |
コンパイル時間 | 1,676 ms |
コンパイル使用メモリ | 192,612 KB |
最終ジャッジ日時 | 2025-01-15 06:38:20 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll func(ll x) { ll sum = 0; while(x > 0) { sum += x % 10; x /= 10; } return sum; } int main() { ll ans; cin >> ans; for(int i = 0; i < 100; ++i) { ans = func(ans); } cout << ans << endl; return 0; }