結果
問題 |
No.1168 Digit Sum Sequence
|
ユーザー |
|
提出日時 | 2020-08-22 18:31:46 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 14,503 ms |
コンパイル使用メモリ | 237,532 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 12:06:39 |
合計ジャッジ時間 | 15,607 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 |
ソースコード
package main import ( "strings" "fmt" "strconv" ) func main() { var input string result := []int{} fmt.Scan(&input) n, _ := strconv.Atoi(input) result = append(result, n) for i := 0; i < 100; i++ { x := strconv.Itoa(result[i]) y := strings.Split(x, "") var z int for _, a := range y { m, _ := strconv.Atoi(a) z += m } result = append(result, z) } fmt.Println(result[99]) }