結果

問題 No.478 一般門松列列
ユーザー htkbhtkb
提出日時 2017-02-01 22:57:54
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 14,062 ms
コンパイル使用メモリ 418,200 KB
実行使用メモリ 56,608 KB
最終ジャッジ日時 2023-08-12 17:24:19
合計ジャッジ時間 28,611 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 341 ms
54,132 KB
testcase_01 AC 339 ms
55,316 KB
testcase_02 AC 344 ms
54,096 KB
testcase_03 AC 347 ms
54,172 KB
testcase_04 AC 378 ms
53,872 KB
testcase_05 AC 348 ms
54,072 KB
testcase_06 AC 348 ms
54,008 KB
testcase_07 AC 347 ms
53,940 KB
testcase_08 AC 347 ms
54,080 KB
testcase_09 AC 349 ms
53,992 KB
testcase_10 AC 349 ms
53,880 KB
testcase_11 AC 371 ms
56,032 KB
testcase_12 AC 370 ms
54,244 KB
testcase_13 AC 374 ms
56,608 KB
testcase_14 AC 370 ms
56,168 KB
testcase_15 AC 374 ms
54,016 KB
testcase_16 AC 372 ms
53,900 KB
testcase_17 AC 375 ms
53,896 KB
testcase_18 AC 367 ms
54,088 KB
testcase_19 AC 372 ms
56,528 KB
testcase_20 AC 365 ms
53,968 KB
testcase_21 AC 367 ms
54,296 KB
testcase_22 AC 368 ms
53,948 KB
testcase_23 AC 371 ms
53,964 KB
testcase_24 AC 369 ms
53,972 KB
testcase_25 AC 365 ms
53,976 KB
testcase_26 AC 358 ms
54,232 KB
testcase_27 AC 359 ms
54,116 KB
testcase_28 AC 357 ms
54,236 KB
testcase_29 AC 351 ms
54,324 KB
testcase_30 AC 362 ms
53,944 KB
testcase_31 AC 362 ms
54,152 KB
testcase_32 AC 362 ms
54,108 KB
testcase_33 AC 364 ms
54,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val k = sc.nextInt()
    val nums = "4032"
    var answer = StringBuilder()
    var last = "4"
    for (i in 0..n-1-k) {
        last = nums[i % 4].toString()
        answer.append(last, " ")
    }
    for (i in 1..k) answer.append(last, " ")

    println(answer.toString().trim())

}
0