結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-21 23:27:09 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 405 bytes |
| コンパイル時間 | 705 ms |
| コンパイル使用メモリ | 91,252 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-22 08:10:34 |
| 合計ジャッジ時間 | 1,504 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
// Vicfred
// https://yukicoder.me/problems/no/1170
// implementation
import std.conv;
import std.stdio;
import std.string;
void main() {
string N;
long[101] a;
N = readln.strip;
foreach(digit; N)
a[0] += digit - '0';
for(int i = 1; i <= 100; i++) {
N = a[i-1].to!string;
foreach(digit; N)
a[i] += digit - '0';
}
a[100].writeln;
}