結果

問題 No.970 数列変換マシン
コンテスト
ユーザー yakamoto
提出日時 2020-01-17 21:28:57
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
WA  
実行時間 -
コード長 1,138 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,943 ms
コンパイル使用メモリ 461,868 KB
実行使用メモリ 86,944 KB
最終ジャッジ日時 2026-03-12 04:03:29
合計ジャッジ時間 19,892 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.lang.Exception
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

fun main() {
  val (N) = readInts()
  val Y = readInts()
  val s = Y.sum()
  val ans = mutableListOf<Int>()
  for (i in 0 until N) {
    val v = (s-Y[i])*(N-1)-s
    ans.add(v)
  }
  println(ans.joinToString(" "))
}












































private val isDebug = try {
  // なんか本番でエラーでる
  System.getenv("MY_DEBUG") != null
} catch (t: Throwable) {
  false
}

private fun readLn() = readLine()!!
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }.toIntArray()
private fun readLongs() = readStrings().map { it.toLong() }.toLongArray()
private inline fun debug(msg: () -> String) {
  if (isDebug) System.err.println(msg())
}
private fun debug(a: LongArray) {
  debug{a.joinToString(" ")}
}
private fun debug(a: IntArray) {
  debug{a.joinToString(" ")}
}
private fun debug(a: BooleanArray) {
  debug{a.map{if(it) 1 else 0}.joinToString("")}
}
private fun debugDim(A: Array<IntArray>) {
  if (isDebug) {
    for (a in A) {
      debug(a)
    }
  }
}
0