結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-07 11:31:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 256 bytes |
| コンパイル時間 | 1,706 ms |
| コンパイル使用メモリ | 190,896 KB |
| 最終ジャッジ日時 | 2025-01-19 12:33:23 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
int f(int x){
int ans=0;
while(x>0){
ans+=x%10;
x/=10;
}
return ans;
}
int main(){
int n; cin>>n;
rep(i,100) n=f(n);
cout<<n<<endl;
}