結果

問題 No.793 うし数列 2
ユーザー simansiman
提出日時 2021-04-02 01:42:17
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 149 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 11,384 KB
実行使用メモリ 19,380 KB
最終ジャッジ日時 2023-08-23 08:35:38
合計ジャッジ時間 6,245 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,152 KB
testcase_01 AC 79 ms
15,080 KB
testcase_02 AC 79 ms
15,260 KB
testcase_03 AC 78 ms
15,284 KB
testcase_04 AC 82 ms
15,124 KB
testcase_05 AC 103 ms
15,292 KB
testcase_06 AC 164 ms
15,352 KB
testcase_07 AC 119 ms
15,004 KB
testcase_08 AC 173 ms
15,092 KB
testcase_09 AC 143 ms
15,280 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
MOD = 10 ** 9 + 7

ans = 0
base = 1

N.times do |i|
  ans += 3 * base
  base *= 10
  base %= MOD
end

ans += base
ans %= MOD

puts ans
0