結果
問題 | No.1168 Digit Sum Sequence |
ユーザー |
![]() |
提出日時 | 2020-08-14 21:55:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 427 bytes |
コンパイル時間 | 2,121 ms |
コンパイル使用メモリ | 191,172 KB |
最終ジャッジ日時 | 2025-01-12 23:44:00 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define tezz std::ios::sync_with_stdio(false);std::cout.tie(NULL);std:cin.tie(NULL); ll ss(ll n){ ll r=0; while(n){ r+=(n%10); n/=10; } return r; } int main() { ll n; cin>>n; ll c=1; ll r=0; while(c<101) { c++; r=ss(n); n=r; if(c==101) break; } cout<<r<<endl; }