結果

問題 No.970 数列変換マシン
ユーザー ks2mks2m
提出日時 2020-01-17 21:26:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 3,809 ms
コンパイル使用メモリ 71,384 KB
実行使用メモリ 62,696 KB
最終ジャッジ日時 2023-09-08 01:30:32
合計ジャッジ時間 7,521 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 241 ms
62,360 KB
testcase_01 AC 240 ms
62,696 KB
testcase_02 AC 230 ms
62,336 KB
testcase_03 AC 218 ms
60,080 KB
testcase_04 AC 217 ms
60,236 KB
testcase_05 AC 223 ms
62,624 KB
testcase_06 AC 179 ms
60,704 KB
testcase_07 AC 222 ms
60,176 KB
testcase_08 AC 220 ms
60,272 KB
testcase_09 AC 52 ms
49,912 KB
testcase_10 AC 51 ms
49,796 KB
testcase_11 AC 57 ms
51,108 KB
testcase_12 AC 54 ms
51,164 KB
testcase_13 AC 49 ms
49,584 KB
testcase_14 AC 60 ms
50,868 KB
testcase_15 AC 40 ms
49,292 KB
testcase_16 AC 41 ms
49,276 KB
testcase_17 AC 41 ms
49,504 KB
testcase_18 AC 41 ms
49,312 KB
testcase_19 AC 40 ms
49,448 KB
testcase_20 AC 40 ms
47,268 KB
testcase_21 AC 39 ms
49,256 KB
testcase_22 AC 40 ms
49,240 KB
testcase_23 AC 41 ms
49,368 KB
testcase_24 AC 40 ms
49,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] sa = br.readLine().split(" ");
		int[] y = new int[n];
		int sum = 0;
		for (int i = 0; i < n; i++) {
			y[i] = Integer.parseInt(sa[i]);
			sum += y[i];
		}
		br.close();

		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < n; i++) {
			int x = sum - y[i] * (n - 1);
			sb.append(x).append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		System.out.println(sb.toString());
	}
}
0