結果

問題 No.970 数列変換マシン
ユーザー yakamotoyakamoto
提出日時 2020-01-17 21:30:38
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 1,148 bytes
コンパイル時間 14,211 ms
コンパイル使用メモリ 422,592 KB
実行使用メモリ 69,728 KB
最終ジャッジ日時 2023-09-08 01:40:19
合計ジャッジ時間 27,123 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 558 ms
59,128 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 304 ms
56,704 KB
testcase_16 AC 308 ms
57,100 KB
testcase_17 AC 311 ms
56,924 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 316 ms
56,824 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 308 ms
56,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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<Long>()
  for (i in 0 until N) {
    val v = (s-Y[i]).toLong()*(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