結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー | エセ賢者 |
提出日時 | 2023-07-16 15:48:09 |
言語 | Kotlin (1.9.23) |
結果 |
AC
|
実行時間 | 507 ms / 2,000 ms |
コード長 | 1,703 bytes |
コンパイル時間 | 12,818 ms |
コンパイル使用メモリ | 423,880 KB |
実行使用メモリ | 72,708 KB |
スコア | 79,766 |
平均クエリ数 | 293.22 |
最終ジャッジ日時 | 2023-07-16 15:49:08 |
合計ジャッジ時間 | 55,638 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 337 ms
68,880 KB |
testcase_01 | AC | 361 ms
71,228 KB |
testcase_02 | AC | 344 ms
69,816 KB |
testcase_03 | AC | 323 ms
69,536 KB |
testcase_04 | AC | 366 ms
69,672 KB |
testcase_05 | AC | 335 ms
69,012 KB |
testcase_06 | AC | 405 ms
69,772 KB |
testcase_07 | AC | 345 ms
69,344 KB |
testcase_08 | AC | 367 ms
69,608 KB |
testcase_09 | AC | 338 ms
69,548 KB |
testcase_10 | AC | 499 ms
72,708 KB |
testcase_11 | AC | 350 ms
70,016 KB |
testcase_12 | AC | 358 ms
69,408 KB |
testcase_13 | AC | 370 ms
69,160 KB |
testcase_14 | AC | 342 ms
69,692 KB |
testcase_15 | AC | 333 ms
69,328 KB |
testcase_16 | AC | 360 ms
69,592 KB |
testcase_17 | AC | 483 ms
72,260 KB |
testcase_18 | AC | 483 ms
72,320 KB |
testcase_19 | AC | 345 ms
68,860 KB |
testcase_20 | AC | 342 ms
69,200 KB |
testcase_21 | AC | 354 ms
69,020 KB |
testcase_22 | AC | 398 ms
69,464 KB |
testcase_23 | AC | 359 ms
69,756 KB |
testcase_24 | AC | 355 ms
69,220 KB |
testcase_25 | AC | 343 ms
69,352 KB |
testcase_26 | AC | 347 ms
69,308 KB |
testcase_27 | AC | 346 ms
69,620 KB |
testcase_28 | AC | 362 ms
69,104 KB |
testcase_29 | AC | 358 ms
69,444 KB |
testcase_30 | AC | 348 ms
69,116 KB |
testcase_31 | AC | 382 ms
69,596 KB |
testcase_32 | AC | 342 ms
69,204 KB |
testcase_33 | AC | 339 ms
69,560 KB |
testcase_34 | AC | 391 ms
69,140 KB |
testcase_35 | AC | 358 ms
69,388 KB |
testcase_36 | AC | 329 ms
68,812 KB |
testcase_37 | AC | 344 ms
68,972 KB |
testcase_38 | AC | 350 ms
69,188 KB |
testcase_39 | AC | 339 ms
68,920 KB |
testcase_40 | AC | 360 ms
69,628 KB |
testcase_41 | AC | 336 ms
68,884 KB |
testcase_42 | AC | 372 ms
69,412 KB |
testcase_43 | AC | 380 ms
68,980 KB |
testcase_44 | AC | 346 ms
68,852 KB |
testcase_45 | AC | 356 ms
69,660 KB |
testcase_46 | AC | 373 ms
68,896 KB |
testcase_47 | AC | 323 ms
69,312 KB |
testcase_48 | AC | 356 ms
69,472 KB |
testcase_49 | AC | 357 ms
69,412 KB |
testcase_50 | AC | 338 ms
68,888 KB |
testcase_51 | AC | 348 ms
68,960 KB |
testcase_52 | AC | 377 ms
69,284 KB |
testcase_53 | AC | 362 ms
68,936 KB |
testcase_54 | AC | 507 ms
72,256 KB |
testcase_55 | AC | 340 ms
69,200 KB |
testcase_56 | AC | 346 ms
68,944 KB |
testcase_57 | AC | 372 ms
69,588 KB |
testcase_58 | AC | 361 ms
69,044 KB |
testcase_59 | AC | 350 ms
69,400 KB |
testcase_60 | AC | 505 ms
72,596 KB |
testcase_61 | AC | 354 ms
69,572 KB |
testcase_62 | AC | 350 ms
69,500 KB |
testcase_63 | AC | 405 ms
69,580 KB |
testcase_64 | AC | 356 ms
69,548 KB |
testcase_65 | AC | 416 ms
71,624 KB |
testcase_66 | AC | 394 ms
69,456 KB |
testcase_67 | AC | 339 ms
69,240 KB |
testcase_68 | AC | 365 ms
69,524 KB |
testcase_69 | AC | 449 ms
69,164 KB |
testcase_70 | AC | 341 ms
69,700 KB |
testcase_71 | AC | 345 ms
69,528 KB |
testcase_72 | AC | 346 ms
69,352 KB |
testcase_73 | AC | 347 ms
69,036 KB |
testcase_74 | AC | 323 ms
69,456 KB |
testcase_75 | AC | 385 ms
69,276 KB |
testcase_76 | AC | 358 ms
69,144 KB |
testcase_77 | AC | 354 ms
69,356 KB |
testcase_78 | AC | 487 ms
72,208 KB |
testcase_79 | AC | 363 ms
69,868 KB |
testcase_80 | AC | 371 ms
69,040 KB |
testcase_81 | AC | 344 ms
69,280 KB |
testcase_82 | AC | 362 ms
69,936 KB |
testcase_83 | AC | 354 ms
70,396 KB |
testcase_84 | AC | 391 ms
69,704 KB |
testcase_85 | AC | 347 ms
69,032 KB |
testcase_86 | AC | 347 ms
71,220 KB |
testcase_87 | AC | 354 ms
69,544 KB |
testcase_88 | AC | 437 ms
71,372 KB |
testcase_89 | AC | 369 ms
69,452 KB |
testcase_90 | AC | 363 ms
69,500 KB |
testcase_91 | AC | 341 ms
68,952 KB |
testcase_92 | AC | 357 ms
69,224 KB |
testcase_93 | AC | 349 ms
69,492 KB |
testcase_94 | AC | 333 ms
68,828 KB |
testcase_95 | AC | 340 ms
69,048 KB |
testcase_96 | AC | 507 ms
71,788 KB |
testcase_97 | AC | 342 ms
69,692 KB |
testcase_98 | AC | 355 ms
68,960 KB |
testcase_99 | AC | 359 ms
69,052 KB |
コンパイルメッセージ
Main.kt:10:10: warning: parameter 'args' is never used fun main(args: Array<String>) { ^ Main.kt:14:9: warning: variable 'power' is never used var power = 100 ^ Main.kt:35:56: warning: identity equality for arguments of types Int and Int is deprecated val sameLineEnemyList = enemyList.filter { it.x === own } ^
ソースコード
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>) { var turn = 0 var enemyList = mutableListOf<Enemy>() var own = 12 var power = 100 while (turn < 1000) { val n = nextInt() if (n == -1) { return } val newEnemyList = mutableListOf<Enemy>() for (enemy in enemyList) { val isAlive = enemy.nextTurn() if (isAlive) { newEnemyList.add(enemy) } } enemyList = newEnemyList for (i in 0 until n) { val hpx = nextIntList() enemyList.add(Enemy(hpx[2], 59, hpx[0], hpx[1])) } if (enemyList.isEmpty()) { println("S") } else { val sameLineEnemyList = enemyList.filter { it.x === own } if (sameLineEnemyList.isEmpty()) { if (Math.random() < 0.5) { println("R") own++ } else { println("L") own-- } } else { println("S") } } turn++ } } class Enemy(var x: Int, var y: Int, var h: Int, var p: Int) { fun nextTurn(): Boolean { y-- return y >= 0 } }