結果

問題 No.741 AscNumber(Easy)
ユーザー tsuchinagatsuchinaga
提出日時 2019-05-21 12:36:57
言語 Go
(1.21.3)
結果
AC  
実行時間 919 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 14,891 ms
コンパイル使用メモリ 220,468 KB
実行使用メモリ 6,616 KB
最終ジャッジ日時 2023-10-17 10:31:49
合計ジャッジ時間 28,779 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 2 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 1 ms
4,348 KB
testcase_28 AC 1 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 1 ms
4,348 KB
testcase_33 AC 1 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 877 ms
6,616 KB
testcase_36 AC 384 ms
6,604 KB
testcase_37 AC 451 ms
6,608 KB
testcase_38 AC 444 ms
6,616 KB
testcase_39 AC 377 ms
6,616 KB
testcase_40 AC 511 ms
6,612 KB
testcase_41 AC 803 ms
6,616 KB
testcase_42 AC 427 ms
6,616 KB
testcase_43 AC 309 ms
6,616 KB
testcase_44 AC 627 ms
6,616 KB
testcase_45 AC 675 ms
6,608 KB
testcase_46 AC 834 ms
6,616 KB
testcase_47 AC 144 ms
6,616 KB
testcase_48 AC 835 ms
6,616 KB
testcase_49 AC 696 ms
6,616 KB
testcase_50 AC 98 ms
6,612 KB
testcase_51 AC 324 ms
6,608 KB
testcase_52 AC 919 ms
6,608 KB
testcase_53 AC 919 ms
6,608 KB
testcase_54 AC 913 ms
6,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"math"
)

func main() {
	var n int
	_, _ = fmt.Scan(&n)

	mod := int(math.Pow10(9)) + 7
	nums := map[int]int{1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1}
	ans := 10
	for i := 2; i <= n; i++ {
		total := 0
		tmp := make(map[int]int)
		for j := 9; j >= 1; j-- {
			total = (total + nums[j]) % mod
			tmp[j] = total
			ans = (ans + total) % mod
		}
		nums = tmp
	}
	fmt.Println(ans)
}
0