結果

問題 No.2184 A○B問題
ユーザー 👑 箱
提出日時 2022-10-10 17:59:50
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 920 bytes
コンパイル時間 15,054 ms
コンパイル使用メモリ 425,892 KB
実行使用メモリ 55,560 KB
最終ジャッジ日時 2023-09-06 17:34:50
合計ジャッジ時間 24,028 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 299 ms
53,288 KB
testcase_01 AC 303 ms
53,676 KB
testcase_02 AC 308 ms
55,104 KB
testcase_03 AC 313 ms
53,512 KB
testcase_04 AC 310 ms
53,364 KB
testcase_05 AC 304 ms
53,300 KB
testcase_06 AC 306 ms
55,560 KB
testcase_07 AC 300 ms
53,312 KB
testcase_08 AC 303 ms
53,420 KB
testcase_09 AC 301 ms
55,328 KB
testcase_10 AC 297 ms
55,312 KB
testcase_11 AC 301 ms
55,388 KB
testcase_12 AC 304 ms
55,220 KB
testcase_13 AC 305 ms
55,156 KB
testcase_14 AC 305 ms
55,232 KB
testcase_15 AC 302 ms
53,316 KB
testcase_16 AC 302 ms
55,324 KB
testcase_17 AC 304 ms
53,372 KB
testcase_18 AC 304 ms
55,064 KB
testcase_19 AC 303 ms
53,328 KB
testcase_20 AC 304 ms
55,056 KB
testcase_21 AC 303 ms
55,284 KB
testcase_22 AC 304 ms
53,476 KB
testcase_23 AC 306 ms
53,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fun PrintWriter.solve() {
    val a = Array(5) { nextInt() }
    val b = Array(5) { nextInt() }
    val ab = (0 until 5).map { a[b[it] - 1] }
    println(ab.joinToString(" "))
}

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