結果

問題 No.970 数列変換マシン
ユーザー 37zigen37zigen
提出日時 2020-03-18 19:11:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,034 ms / 2,000 ms
コード長 560 bytes
コンパイル時間 1,699 ms
コンパイル使用メモリ 73,992 KB
実行使用メモリ 67,456 KB
最終ジャッジ日時 2023-08-20 20:10:47
合計ジャッジ時間 15,896 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 960 ms
67,372 KB
testcase_01 AC 974 ms
67,400 KB
testcase_02 AC 1,000 ms
67,456 KB
testcase_03 AC 979 ms
67,284 KB
testcase_04 AC 1,010 ms
67,364 KB
testcase_05 AC 1,019 ms
67,348 KB
testcase_06 AC 913 ms
67,356 KB
testcase_07 AC 989 ms
67,368 KB
testcase_08 AC 1,034 ms
67,004 KB
testcase_09 AC 247 ms
59,812 KB
testcase_10 AC 231 ms
60,580 KB
testcase_11 AC 246 ms
59,668 KB
testcase_12 AC 245 ms
60,056 KB
testcase_13 AC 229 ms
60,660 KB
testcase_14 AC 275 ms
61,552 KB
testcase_15 AC 133 ms
56,856 KB
testcase_16 AC 128 ms
56,784 KB
testcase_17 AC 133 ms
56,860 KB
testcase_18 AC 133 ms
56,852 KB
testcase_19 AC 131 ms
56,756 KB
testcase_20 AC 128 ms
56,796 KB
testcase_21 AC 130 ms
56,872 KB
testcase_22 AC 131 ms
56,492 KB
testcase_23 AC 130 ms
56,772 KB
testcase_24 AC 138 ms
56,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		long[] y=new long[n];
		for(int i=0;i<n;++i)y[i]=sc.nextLong();
		long tot=0;
		for(int i=0;i<n;++i)tot+=y[i];
		for(int i=0;i<n;++i) {
			System.out.print((tot-(n-1)*y[i])+(i==n-1?"\n":" "));
		}
		
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0