結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-03 10:41:40 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 826 bytes |
| コンパイル時間 | 3,386 ms |
| コンパイル使用メモリ | 244,936 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 22:17:09 |
| 合計ジャッジ時間 | 3,924 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ch = char;
using ll = long long;
using ld = long double;
using db = double;
using st = string;
using vdb = vector<db>;
using vvdb = vector<vdb>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<ld>;
using vvd = vector<vd>;
using vs = vector<st>;
using vvs = vector<vs>;
using vc = vector<ch>;
using vvc = vector<vc>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
const ll mod = 998244353;
const ll MOD = 1000000007;
using vp = vector<pair<ll,ll>>;
#define fi first
#define se second
ll keta(ll a){
ll ans=0;
while(a!=0){
ans+=a%10;
a/=10;
}
return ans;
}
int main(){
ll N;
cin>>N;
vl X(100);
X[0]=N;
for(int i=1; i<100; i++){
X[i]=keta(X[i-1]);
}
cout<<X[99]<<endl;
}