結果

問題 No.970 数列変換マシン
ユーザー rhincodon66rhincodon66
提出日時 2020-01-17 21:52:06
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 570 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 14,415 ms
コンパイル使用メモリ 421,032 KB
実行使用メモリ 63,796 KB
最終ジャッジ日時 2023-09-08 02:29:37
合計ジャッジ時間 26,253 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 548 ms
60,008 KB
testcase_01 AC 545 ms
59,984 KB
testcase_02 AC 560 ms
59,980 KB
testcase_03 AC 555 ms
59,788 KB
testcase_04 AC 556 ms
59,908 KB
testcase_05 AC 570 ms
63,796 KB
testcase_06 AC 524 ms
57,976 KB
testcase_07 AC 560 ms
59,872 KB
testcase_08 AC 562 ms
59,884 KB
testcase_09 AC 315 ms
53,228 KB
testcase_10 AC 316 ms
53,048 KB
testcase_11 AC 336 ms
53,472 KB
testcase_12 AC 326 ms
53,088 KB
testcase_13 AC 320 ms
52,924 KB
testcase_14 AC 342 ms
53,200 KB
testcase_15 AC 292 ms
52,916 KB
testcase_16 AC 293 ms
52,880 KB
testcase_17 AC 292 ms
52,916 KB
testcase_18 AC 292 ms
53,096 KB
testcase_19 AC 290 ms
52,908 KB
testcase_20 AC 298 ms
52,972 KB
testcase_21 AC 292 ms
52,880 KB
testcase_22 AC 294 ms
52,880 KB
testcase_23 AC 294 ms
52,848 KB
testcase_24 AC 290 ms
52,868 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 n = readLine()!!.toInt()
    val y = readLine()!!.split(" ").map{it.toLong()}
    val sum = y.sum()
    var x = LongArray(n)
    for(i in 0 until n){
        x[i] = sum - y[i] * (n - 1)
    }
    val st = StringBuilder()
    for(i in 0 until n){
        st.append(x[i])
        st.append(' ')
    }
    println(st.toString())
}
0