結果
問題 | No.1168 Digit Sum Sequence |
ユーザー |
![]() |
提出日時 | 2020-08-14 21:21:12 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 308 bytes |
コンパイル時間 | 1,961 ms |
コンパイル使用メモリ | 190,640 KB |
最終ジャッジ日時 | 2025-01-12 23:03:13 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000 int main(){ int N; cin>>N; for(int i=0;i<99;i++){ int n = 0; while(N!=0){ n += N%10; N/=10; } N = n; } cout<<N<<endl; return 0; }