結果

問題 No.2186 冪乗の片側極限
ユーザー 👑 箱
提出日時 2023-01-13 21:29:32
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 277 ms / 2,000 ms
コード長 934 bytes
コンパイル時間 14,938 ms
コンパイル使用メモリ 422,532 KB
実行使用メモリ 54,896 KB
最終ジャッジ日時 2023-08-26 03:02:49
合計ジャッジ時間 32,904 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
52,800 KB
testcase_01 AC 277 ms
52,604 KB
testcase_02 AC 273 ms
54,616 KB
testcase_03 AC 269 ms
54,724 KB
testcase_04 AC 268 ms
52,468 KB
testcase_05 AC 269 ms
52,772 KB
testcase_06 AC 269 ms
52,464 KB
testcase_07 AC 269 ms
52,612 KB
testcase_08 AC 272 ms
52,908 KB
testcase_09 AC 273 ms
54,444 KB
testcase_10 AC 270 ms
54,696 KB
testcase_11 AC 270 ms
54,384 KB
testcase_12 AC 269 ms
54,468 KB
testcase_13 AC 267 ms
52,612 KB
testcase_14 AC 271 ms
54,400 KB
testcase_15 AC 270 ms
54,712 KB
testcase_16 AC 271 ms
54,724 KB
testcase_17 AC 272 ms
52,764 KB
testcase_18 AC 271 ms
52,572 KB
testcase_19 AC 268 ms
54,404 KB
testcase_20 AC 266 ms
52,784 KB
testcase_21 AC 267 ms
52,636 KB
testcase_22 AC 273 ms
54,368 KB
testcase_23 AC 269 ms
52,460 KB
testcase_24 AC 267 ms
52,656 KB
testcase_25 AC 268 ms
54,812 KB
testcase_26 AC 272 ms
54,404 KB
testcase_27 AC 269 ms
54,468 KB
testcase_28 AC 265 ms
52,972 KB
testcase_29 AC 268 ms
54,576 KB
testcase_30 AC 268 ms
52,456 KB
testcase_31 AC 271 ms
52,460 KB
testcase_32 AC 274 ms
54,612 KB
testcase_33 AC 269 ms
52,612 KB
testcase_34 AC 269 ms
52,456 KB
testcase_35 AC 274 ms
52,604 KB
testcase_36 AC 271 ms
52,468 KB
testcase_37 AC 274 ms
52,524 KB
testcase_38 AC 269 ms
52,420 KB
testcase_39 AC 271 ms
54,460 KB
testcase_40 AC 270 ms
54,464 KB
testcase_41 AC 272 ms
52,572 KB
testcase_42 AC 272 ms
52,396 KB
testcase_43 AC 273 ms
52,460 KB
testcase_44 AC 271 ms
52,880 KB
testcase_45 AC 275 ms
54,440 KB
testcase_46 AC 271 ms
54,420 KB
testcase_47 AC 276 ms
52,496 KB
testcase_48 AC 273 ms
54,896 KB
testcase_49 AC 272 ms
52,604 KB
testcase_50 AC 269 ms
54,528 KB
testcase_51 AC 273 ms
52,516 KB
testcase_52 AC 274 ms
54,508 KB
testcase_53 AC 274 ms
52,380 KB
testcase_54 AC 272 ms
54,608 KB
testcase_55 AC 274 ms
52,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val a = nextInt()
    val b = nextInt()
    if (a == 0 && b == 0) {
        println(0)
    } else {
        println(Array(b) { a }.fold(1L, Long::times))
    }
}

fun main() {
    Thread(null, {
        val writer = PrintWriter(System.out, false)
        writer.solve()
        writer.flush()
    }, "solve", abs(1L.shl(26)))
        .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
        .apply { start() }.join()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0