結果

問題 No.1407 Kindness
ユーザー yuruhiyayuruhiya
提出日時 2021-02-27 18:00:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 21,248 KB
最終ジャッジ日時 2024-04-10 15:45:25
合計ジャッジ時間 5,692 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,288 KB
testcase_01 AC 79 ms
12,160 KB
testcase_02 AC 79 ms
12,416 KB
testcase_03 AC 79 ms
12,288 KB
testcase_04 AC 82 ms
12,160 KB
testcase_05 AC 80 ms
12,416 KB
testcase_06 AC 79 ms
12,160 KB
testcase_07 AC 79 ms
12,160 KB
testcase_08 AC 82 ms
12,416 KB
testcase_09 AC 76 ms
12,288 KB
testcase_10 AC 85 ms
12,160 KB
testcase_11 AC 87 ms
12,416 KB
testcase_12 AC 155 ms
20,096 KB
testcase_13 AC 108 ms
13,312 KB
testcase_14 AC 101 ms
14,464 KB
testcase_15 AC 146 ms
19,200 KB
testcase_16 AC 122 ms
15,232 KB
testcase_17 AC 111 ms
14,720 KB
testcase_18 AC 107 ms
14,848 KB
testcase_19 AC 136 ms
17,664 KB
testcase_20 AC 133 ms
17,280 KB
testcase_21 AC 87 ms
12,416 KB
testcase_22 AC 95 ms
12,672 KB
testcase_23 AC 131 ms
17,152 KB
testcase_24 AC 161 ms
20,992 KB
testcase_25 AC 108 ms
14,720 KB
testcase_26 AC 119 ms
15,104 KB
testcase_27 AC 92 ms
12,672 KB
testcase_28 AC 148 ms
18,944 KB
testcase_29 AC 88 ms
12,288 KB
testcase_30 AC 149 ms
19,840 KB
testcase_31 AC 103 ms
13,312 KB
testcase_32 AC 141 ms
17,664 KB
testcase_33 AC 102 ms
14,592 KB
testcase_34 AC 123 ms
15,232 KB
testcase_35 AC 100 ms
13,696 KB
testcase_36 AC 81 ms
12,160 KB
testcase_37 AC 147 ms
21,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

M = 10**9 + 7
a = gets.chop.chars.map(&:to_i)
x, y = a[0], (0...a[0]).sum
(1...a.size).each do |i|
	y = (x * (0...a[i]).sum + y * 45 + 45) % M
	x = x * a[i] % M
end
puts (x + y) % M
0