結果

問題 No.16 累乗の加算
ユーザー nakamura sosukenakamura sosuke
提出日時 2019-07-08 11:04:00
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 132 bytes
コンパイル時間 65 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 67,940 KB
最終ジャッジ日時 2024-04-16 21:12:02
合計ジャッジ時間 28,859 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
12,160 KB
testcase_01 AC 91 ms
12,032 KB
testcase_02 TLE -
testcase_03 WA -
testcase_04 TLE -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

x, N = gets.split.map(&:to_i)
as   = gets.split.map(&:to_i)

A = 10 ** 6 + 3

ans = 0
as.each do | a |
  ans += x ** a
end
p ans % A
0