結果

問題 No.3090 Knapsack Function
ユーザー 👑 箱星箱星
提出日時 2022-04-01 21:33:44
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 936 bytes
コンパイル時間 13,578 ms
コンパイル使用メモリ 444,536 KB
実行使用メモリ 97,308 KB
最終ジャッジ日時 2024-04-30 13:16:00
合計ジャッジ時間 23,001 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 331 ms
62,028 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 332 ms
62,076 KB
testcase_05 AC 326 ms
62,148 KB
testcase_06 WA -
testcase_07 AC 334 ms
62,212 KB
testcase_08 AC 333 ms
62,204 KB
testcase_09 WA -
testcase_10 AC 329 ms
62,216 KB
testcase_11 AC 330 ms
62,272 KB
testcase_12 AC 332 ms
62,152 KB
testcase_13 AC 333 ms
62,080 KB
testcase_14 AC 331 ms
62,056 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 573 ms
97,040 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:7:13: warning: variable 'w' is never used
    val (v, w) = Array(n) { nextInt() to nextInt() }.unzip().toList().map { it.toTypedArray() }
            ^

ソースコード

diff #

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

fun PrintWriter.solve() {
    val n = nextInt()
    val (v, w) = Array(n) { nextInt() to nextInt() }.unzip().toList().map { it.toTypedArray() }
    println(if (v.contains(1)) "Yes" else "No")
}

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