結果

問題 No.909 たぴの配置
ユーザー tentententen
提出日時 2020-12-01 10:14:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,111 ms / 3,000 ms
コード長 790 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 72,448 KB
実行使用メモリ 68,332 KB
最終ジャッジ日時 2023-10-11 03:25:41
合計ジャッジ時間 18,359 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
53,928 KB
testcase_01 AC 125 ms
55,656 KB
testcase_02 AC 126 ms
55,892 KB
testcase_03 AC 124 ms
55,904 KB
testcase_04 AC 126 ms
55,396 KB
testcase_05 AC 983 ms
67,076 KB
testcase_06 AC 1,068 ms
67,820 KB
testcase_07 AC 996 ms
66,612 KB
testcase_08 AC 967 ms
66,876 KB
testcase_09 AC 1,111 ms
66,940 KB
testcase_10 AC 994 ms
67,000 KB
testcase_11 AC 967 ms
67,148 KB
testcase_12 AC 1,038 ms
64,812 KB
testcase_13 AC 965 ms
66,996 KB
testcase_14 AC 981 ms
68,332 KB
testcase_15 AC 1,027 ms
67,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min = Integer.MAX_VALUE;
        int[] xArr = new int[n];
        int[] yArr = new int[n];
        for (int i = 0; i < n; i++) {
            xArr[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            yArr[i] = sc.nextInt();
            min = Math.min(min, xArr[i] + yArr[i]);
        }
        StringBuilder sb = new StringBuilder();
        sb.append(min).append("\n");
        sb.append(0).append("\n");
        for (int i = 0; i < n; i++) {
            sb.append(Math.max(min - yArr[i], 0)).append("\n");
        }
        sb.append(min).append("\n");
        System.out.print(sb);
    }
}
0