結果

問題 No.16 累乗の加算
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-08 17:52:07
言語 Kotlin
(1.9.23)
結果
TLE  
実行時間 -
コード長 313 bytes
コンパイル時間 11,815 ms
コンパイル使用メモリ 430,116 KB
実行使用メモリ 170,700 KB
最終ジャッジ日時 2024-04-30 13:01:58
合計ジャッジ時間 18,742 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 327 ms
60,532 KB
testcase_01 AC 327 ms
95,292 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.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) { 
         ^

ソースコード

diff #

import java.math.BigDecimal

fun main(args: Array<String>) { 
  val base = BigDecimal(readLine()!!.split(" ")[0])
  val ans  = readLine()!!.split(" ").map { x -> 
    x.toInt()
  }.map { x ->
    val powed = base.pow(x)
    powed.rem(BigDecimal("1000003")) 
  }.reduce { e, x ->
    e.add(x)
  }
  println(ans)
}
0