結果

問題 No.16 累乗の加算
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-06-19 07:38:32
言語 Nim
(2.0.2)
結果
TLE  
実行時間 -
コード長 258 bytes
コンパイル時間 3,612 ms
コンパイル使用メモリ 68,860 KB
実行使用メモリ 7,092 KB
最終ジャッジ日時 2023-09-13 07:03:17
合計ジャッジ時間 10,320 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils, math

const
  M = 10 ^ 6 + 3
let
  xN, a = stdin.readLine.split.map parseInt
  (x, N) = (xN[0], xN[1])
var
  ttl = newSeq[int](N)

for i, a_i in a:
  var y = 1
  for j in 0 ..< a_i:
    y = (y * x) mod M
  ttl[i] = y

echo ttl.sum
0