結果

問題 No.970 数列変換マシン
ユーザー jp_stejp_ste
提出日時 2020-04-10 07:03:17
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 66,800 KB
最終ジャッジ日時 2023-08-03 03:49:54
合計ジャッジ時間 5,140 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 172 ms
64,916 KB
testcase_01 AC 178 ms
64,980 KB
testcase_02 AC 176 ms
65,176 KB
testcase_03 AC 168 ms
66,620 KB
testcase_04 AC 166 ms
66,432 KB
testcase_05 AC 168 ms
66,800 KB
testcase_06 AC 138 ms
61,680 KB
testcase_07 AC 158 ms
66,376 KB
testcase_08 AC 161 ms
66,224 KB
testcase_09 AC 68 ms
42,624 KB
testcase_10 AC 70 ms
42,628 KB
testcase_11 AC 73 ms
42,908 KB
testcase_12 AC 72 ms
42,396 KB
testcase_13 AC 73 ms
42,348 KB
testcase_14 AC 71 ms
42,624 KB
testcase_15 AC 69 ms
42,332 KB
testcase_16 AC 74 ms
42,204 KB
testcase_17 AC 72 ms
42,200 KB
testcase_18 AC 67 ms
42,224 KB
testcase_19 AC 70 ms
42,240 KB
testcase_20 AC 68 ms
42,180 KB
testcase_21 AC 66 ms
42,184 KB
testcase_22 AC 66 ms
42,372 KB
testcase_23 AC 68 ms
42,192 KB
testcase_24 AC 67 ms
42,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function main(input) {
	input = input.split("\n");
	const n = parseInt(input.shift());
	let y = input.shift().split(" ").map(function(e) {
	   return parseInt(e);     
	});
	let s = y.reduce(function(a, b) {
	   return a + b; 
	}, 0);
	let out = "";
	y.forEach(function(e, i) {
	   if(i > 0) out += " ";
	   out += (s - e * (n - 1));
	});
	console.log(out);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
0