結果

問題 No.16 累乗の加算
ユーザー MaxMellonMaxMellon
提出日時 2015-08-12 15:13:20
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 188 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 11,508 KB
実行使用メモリ 15,276 KB
最終ジャッジ日時 2023-09-25 08:28:21
合計ジャッジ時間 8,170 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,264 KB
testcase_01 AC 85 ms
15,276 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - num
Syntax OK

ソースコード

diff #

require 'bigdecimal'
x, num  = gets.split.map(&:to_i)
arr     = gets.split.map(&:to_i)
sum = 0
arr.each { |i| sum += BigDecimal(BigDecimal(x) ** BigDecimal(i)) }
puts (sum % 1000003).to_i
0