結果
問題 | No.1168 Digit Sum Sequence |
ユーザー | tko919 |
提出日時 | 2020-08-14 21:21:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 621 bytes |
コンパイル時間 | 1,696 ms |
コンパイル使用メモリ | 168,748 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-10 12:20:43 |
合計ジャッジ時間 | 2,364 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; //template #define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12; template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;} template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} //end int main(){ string s; cin>>s; rep(_,0,100){ int x=0; rep(i,0,s.size())x+=(s[i]-'0'); s=to_string(x); } cout<<s<<endl; return 0; }