結果

問題 No.16 累乗の加算
ユーザー mmmpppmmmppp
提出日時 2017-02-28 01:08:30
言語 Ruby
(3.3.0)
結果
AC  
実行時間 3,979 ms / 5,000 ms
コード長 95 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,336 KB
実行使用メモリ 15,244 KB
最終ジャッジ日時 2023-09-08 12:07:28
合計ジャッジ時間 25,229 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,164 KB
testcase_01 AC 81 ms
15,048 KB
testcase_02 AC 3,979 ms
15,200 KB
testcase_03 AC 1,040 ms
15,156 KB
testcase_04 AC 1,167 ms
15,064 KB
testcase_05 AC 1,292 ms
15,196 KB
testcase_06 AC 2,605 ms
15,096 KB
testcase_07 AC 1,847 ms
15,108 KB
testcase_08 AC 2,797 ms
15,024 KB
testcase_09 AC 3,018 ms
15,200 KB
testcase_10 AC 2,365 ms
15,096 KB
testcase_11 AC 159 ms
15,108 KB
testcase_12 AC 2,393 ms
15,244 KB
testcase_13 AC 1,202 ms
15,016 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

d=1000003
x,n,*a=$<.read.split.map &:to_i
s=0;a.map{|e|t=1;(e%~-d).times{t=(t*x)%d};s+=t};p s%d
0