結果

問題 No.970 数列変換マシン
ユーザー C_nena_EC_nena_E
提出日時 2020-01-17 22:05:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,162 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 2,200 ms
コンパイル使用メモリ 75,368 KB
実行使用メモリ 69,796 KB
最終ジャッジ日時 2023-09-08 03:06:59
合計ジャッジ時間 17,536 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,121 ms
69,700 KB
testcase_01 AC 1,151 ms
68,496 KB
testcase_02 AC 1,124 ms
69,356 KB
testcase_03 AC 1,126 ms
69,796 KB
testcase_04 AC 1,162 ms
69,688 KB
testcase_05 AC 1,118 ms
69,436 KB
testcase_06 AC 1,022 ms
69,616 KB
testcase_07 AC 1,113 ms
69,360 KB
testcase_08 AC 1,131 ms
69,332 KB
testcase_09 AC 230 ms
59,704 KB
testcase_10 AC 240 ms
59,288 KB
testcase_11 AC 277 ms
59,864 KB
testcase_12 AC 261 ms
59,300 KB
testcase_13 AC 241 ms
58,848 KB
testcase_14 AC 292 ms
60,952 KB
testcase_15 AC 129 ms
56,060 KB
testcase_16 AC 133 ms
55,812 KB
testcase_17 AC 134 ms
55,748 KB
testcase_18 AC 134 ms
56,032 KB
testcase_19 AC 132 ms
56,600 KB
testcase_20 AC 136 ms
55,960 KB
testcase_21 AC 129 ms
56,208 KB
testcase_22 AC 135 ms
56,064 KB
testcase_23 AC 137 ms
55,944 KB
testcase_24 AC 134 ms
55,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int total = 0;
        List<Integer> li = new ArrayList<Integer>();
        for(int i = 0; i < n; i++){
            int tmp = sc.nextInt();
            li.add(tmp);
            total += tmp;
        }
        int i = 0;
        for(int v: li){
            if(i == n-1){
                System.out.print(total-v*(n-1));
            }else{
                System.out.print(total-v*(n-1)+" ");
            }
            i++;
        }
    }
}

0