結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
LV3zJigVW57oPGy
|
| 提出日時 | 2022-11-10 18:23:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 432 bytes |
| コンパイル時間 | 1,999 ms |
| コンパイル使用メモリ | 159,188 KB |
| 実行使用メモリ | 13,952 KB |
| 最終ジャッジ日時 | 2024-07-23 19:59:55 |
| 合計ジャッジ時間 | 8,411 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 1 |
| other | -- * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <stdio.h>
#include <iomanip>
#include <iostream>
#include <string>
#include <algorithm>
int main(){
int a;
cin >> a;
int count=0;
while(true){
string str;
str = to_string(a);
for(int i=0;i<str.size();i++){
int b = a%10;
a = a/10;
count += b;
}
a = count;
if(a/10==0){
break;
}
}
cout << a;
}
LV3zJigVW57oPGy