結果

問題 No.1738 What's in the box?
ユーザー 👑 箱星箱星
提出日時 2021-11-12 22:23:31
言語 Kotlin
(1.9.23)
結果
RE  
実行時間 -
コード長 923 bytes
コンパイル時間 14,342 ms
コンパイル使用メモリ 441,028 KB
実行使用メモリ 55,624 KB
最終ジャッジ日時 2024-05-04 09:28:48
合計ジャッジ時間 37,536 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
55,252 KB
testcase_01 AC 307 ms
55,300 KB
testcase_02 AC 307 ms
55,092 KB
testcase_03 AC 310 ms
55,420 KB
testcase_04 AC 310 ms
55,520 KB
testcase_05 AC 296 ms
55,396 KB
testcase_06 AC 302 ms
55,516 KB
testcase_07 AC 319 ms
55,416 KB
testcase_08 AC 304 ms
55,292 KB
testcase_09 AC 303 ms
55,448 KB
testcase_10 AC 307 ms
55,596 KB
testcase_11 AC 308 ms
55,288 KB
testcase_12 AC 306 ms
55,552 KB
testcase_13 AC 295 ms
55,400 KB
testcase_14 AC 313 ms
55,236 KB
testcase_15 AC 308 ms
55,164 KB
testcase_16 AC 299 ms
55,352 KB
testcase_17 AC 302 ms
55,168 KB
testcase_18 AC 291 ms
55,308 KB
testcase_19 AC 296 ms
55,292 KB
testcase_20 AC 339 ms
55,292 KB
testcase_21 AC 340 ms
55,336 KB
testcase_22 AC 298 ms
55,352 KB
testcase_23 AC 292 ms
55,180 KB
testcase_24 AC 304 ms
55,500 KB
testcase_25 AC 307 ms
55,308 KB
testcase_26 AC 290 ms
55,164 KB
testcase_27 AC 294 ms
55,300 KB
testcase_28 AC 316 ms
55,480 KB
testcase_29 AC 292 ms
55,312 KB
testcase_30 AC 300 ms
55,184 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 310 ms
55,500 KB
testcase_34 AC 307 ms
55,408 KB
testcase_35 AC 304 ms
55,536 KB
testcase_36 AC 304 ms
55,484 KB
testcase_37 AC 312 ms
55,384 KB
testcase_38 AC 313 ms
55,480 KB
testcase_39 AC 307 ms
55,260 KB
testcase_40 AC 300 ms
55,520 KB
testcase_41 AC 320 ms
55,592 KB
testcase_42 AC 300 ms
55,548 KB
testcase_43 AC 300 ms
55,544 KB
testcase_44 AC 305 ms
55,360 KB
testcase_45 AC 304 ms
55,560 KB
testcase_46 AC 305 ms
55,452 KB
testcase_47 AC 306 ms
55,288 KB
testcase_48 AC 298 ms
55,624 KB
testcase_49 AC 301 ms
55,424 KB
testcase_50 AC 308 ms
55,484 KB
testcase_51 AC 301 ms
55,576 KB
testcase_52 AC 299 ms
55,568 KB
testcase_53 AC 299 ms
55,472 KB
testcase_54 AC 310 ms
55,248 KB
testcase_55 AC 290 ms
55,048 KB
testcase_56 AC 306 ms
55,080 KB
testcase_57 AC 289 ms
55,040 KB
testcase_58 AC 299 ms
55,308 KB
testcase_59 AC 293 ms
55,044 KB
testcase_60 AC 301 ms
55,332 KB
testcase_61 AC 297 ms
55,296 KB
testcase_62 AC 295 ms
55,340 KB
testcase_63 AC 308 ms
55,292 KB
testcase_64 AC 308 ms
55,156 KB
testcase_65 AC 289 ms
55,384 KB
testcase_66 AC 293 ms
55,316 KB
testcase_67 AC 306 ms
55,336 KB
testcase_68 AC 300 ms
55,200 KB
testcase_69 AC 310 ms
55,132 KB
testcase_70 AC 310 ms
55,336 KB
testcase_71 AC 298 ms
55,284 KB
testcase_72 AC 301 ms
55,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fun PrintWriter.solve() {
    val n = nextInt()
    val m = nextLong()
    val w = Array(n) { nextLong() }
    val s = w.sum()
    println(w.map { it * m / s }.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