結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-14 21:22:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 237 bytes |
| コンパイル時間 | 1,613 ms |
| コンパイル使用メモリ | 164,928 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-10 12:26:00 |
| 合計ジャッジ時間 | 2,513 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int N;
cin>>N;
int n=N;
while(n>=10){
int cnt=0;
for(int i=n;i>0;i/=10)cnt+=i%10;
n=cnt;
}
cout<<n<<endl;
}