結果

問題 No.5017 Tool-assisted Shooting
ユーザー エセ賢者エセ賢者
提出日時 2023-08-03 12:47:19
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 473 ms / 2,000 ms
コード長 1,246 bytes
コンパイル時間 15,791 ms
コンパイル使用メモリ 425,908 KB
実行使用メモリ 71,032 KB
スコア 74,830
平均クエリ数 399.74
最終ジャッジ日時 2023-08-03 12:48:21
合計ジャッジ時間 58,125 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 358 ms
68,964 KB
testcase_01 AC 451 ms
69,496 KB
testcase_02 AC 337 ms
69,028 KB
testcase_03 AC 359 ms
68,708 KB
testcase_04 AC 380 ms
69,024 KB
testcase_05 AC 378 ms
69,412 KB
testcase_06 AC 364 ms
68,704 KB
testcase_07 AC 366 ms
69,188 KB
testcase_08 AC 351 ms
68,824 KB
testcase_09 AC 382 ms
68,716 KB
testcase_10 AC 379 ms
69,504 KB
testcase_11 AC 349 ms
69,360 KB
testcase_12 AC 358 ms
69,568 KB
testcase_13 AC 345 ms
68,936 KB
testcase_14 AC 345 ms
69,176 KB
testcase_15 AC 361 ms
69,076 KB
testcase_16 AC 324 ms
69,620 KB
testcase_17 AC 447 ms
69,116 KB
testcase_18 AC 473 ms
69,528 KB
testcase_19 AC 348 ms
68,996 KB
testcase_20 AC 366 ms
69,064 KB
testcase_21 AC 377 ms
69,044 KB
testcase_22 AC 382 ms
69,516 KB
testcase_23 AC 332 ms
69,124 KB
testcase_24 AC 410 ms
69,000 KB
testcase_25 AC 364 ms
68,900 KB
testcase_26 AC 388 ms
68,820 KB
testcase_27 AC 473 ms
69,648 KB
testcase_28 AC 371 ms
69,364 KB
testcase_29 AC 363 ms
68,704 KB
testcase_30 AC 384 ms
69,244 KB
testcase_31 AC 336 ms
68,904 KB
testcase_32 AC 350 ms
68,892 KB
testcase_33 AC 381 ms
69,264 KB
testcase_34 AC 447 ms
69,716 KB
testcase_35 AC 350 ms
68,768 KB
testcase_36 AC 382 ms
69,036 KB
testcase_37 AC 383 ms
69,456 KB
testcase_38 AC 340 ms
69,240 KB
testcase_39 AC 441 ms
69,688 KB
testcase_40 AC 377 ms
68,692 KB
testcase_41 AC 360 ms
68,896 KB
testcase_42 AC 404 ms
69,784 KB
testcase_43 AC 414 ms
69,032 KB
testcase_44 AC 355 ms
69,336 KB
testcase_45 AC 356 ms
68,924 KB
testcase_46 AC 437 ms
68,960 KB
testcase_47 AC 371 ms
68,680 KB
testcase_48 AC 445 ms
69,444 KB
testcase_49 AC 441 ms
69,792 KB
testcase_50 AC 376 ms
69,156 KB
testcase_51 AC 450 ms
69,556 KB
testcase_52 AC 466 ms
69,492 KB
testcase_53 AC 375 ms
69,332 KB
testcase_54 AC 339 ms
69,152 KB
testcase_55 AC 431 ms
69,180 KB
testcase_56 AC 349 ms
69,224 KB
testcase_57 AC 452 ms
69,068 KB
testcase_58 AC 433 ms
69,136 KB
testcase_59 AC 344 ms
68,868 KB
testcase_60 AC 402 ms
68,940 KB
testcase_61 AC 455 ms
69,640 KB
testcase_62 AC 456 ms
69,416 KB
testcase_63 AC 388 ms
69,344 KB
testcase_64 AC 342 ms
69,236 KB
testcase_65 AC 471 ms
69,328 KB
testcase_66 AC 366 ms
69,364 KB
testcase_67 AC 362 ms
68,584 KB
testcase_68 AC 388 ms
69,372 KB
testcase_69 AC 375 ms
68,896 KB
testcase_70 AC 338 ms
69,324 KB
testcase_71 AC 381 ms
69,004 KB
testcase_72 AC 367 ms
69,228 KB
testcase_73 AC 437 ms
68,992 KB
testcase_74 AC 365 ms
68,828 KB
testcase_75 AC 351 ms
69,268 KB
testcase_76 AC 376 ms
69,220 KB
testcase_77 AC 362 ms
69,448 KB
testcase_78 AC 356 ms
69,260 KB
testcase_79 AC 389 ms
69,352 KB
testcase_80 AC 354 ms
69,192 KB
testcase_81 AC 401 ms
69,780 KB
testcase_82 AC 373 ms
69,196 KB
testcase_83 AC 347 ms
69,236 KB
testcase_84 AC 372 ms
69,388 KB
testcase_85 AC 341 ms
68,888 KB
testcase_86 AC 380 ms
69,532 KB
testcase_87 AC 352 ms
71,032 KB
testcase_88 AC 362 ms
69,212 KB
testcase_89 AC 385 ms
69,348 KB
testcase_90 AC 373 ms
69,000 KB
testcase_91 AC 340 ms
69,216 KB
testcase_92 AC 444 ms
69,540 KB
testcase_93 AC 358 ms
68,788 KB
testcase_94 AC 356 ms
68,932 KB
testcase_95 AC 456 ms
69,172 KB
testcase_96 AC 455 ms
69,128 KB
testcase_97 AC 349 ms
69,264 KB
testcase_98 AC 351 ms
69,100 KB
testcase_99 AC 379 ms
68,796 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:10:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

private fun next() = readLine()!!
private fun nextInt() = next().toInt()
private fun nextLong() = next().toLong()
private fun nextDouble() = next().toDouble()
private fun nextList() = next().split(" ")
private fun nextIntList() = next().split(" ").map { it.toInt() }.toIntArray()
private fun nextLongList() = next().split(" ").map { it.toLong() }.toLongArray()
private fun nextDoubleList() = next().split(" ").map { it.toDouble() }.toDoubleArray()

fun main(args: Array<String>) {
    val gameState = GameState()

    while (!gameState.isDone()) {
        val n = nextInt()
        if (n == -1) {
            return
        }
        for (i in 0 until n) {
            val hpx = nextIntList()
            gameState.addEnemy(hpx)
        }
        gameState.nextTurn()
    }
}

class GameState {
    var enemyList = mutableListOf<Enemy>()
    var own = Own(12, 0)
    var turn = 0

    fun addEnemy(hpx: IntArray) {
        enemyList.add(Enemy(hpx[2], 59 + turn, hpx[0], hpx[1]))
    }

    fun isDone(): Boolean {
        return turn >= 1000
    }

    fun nextTurn() {
        turn++
        own = Own(own.x, own.y + 1)
        println("S")
    }
}

class Enemy(var x: Int, var y: Int, var h: Int, var p: Int)

class Own(var x: Int, var y: Int)
0