結果

問題 No.909 たぴの配置
ユーザー ks2mks2m
提出日時 2019-10-18 21:31:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,197 ms / 3,000 ms
コード長 804 bytes
コンパイル時間 2,159 ms
コンパイル使用メモリ 73,764 KB
実行使用メモリ 82,724 KB
最終ジャッジ日時 2023-09-07 21:24:10
合計ジャッジ時間 16,779 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,312 KB
testcase_01 AC 43 ms
49,272 KB
testcase_02 AC 41 ms
49,544 KB
testcase_03 AC 45 ms
49,284 KB
testcase_04 AC 41 ms
49,372 KB
testcase_05 AC 1,096 ms
82,724 KB
testcase_06 AC 1,197 ms
82,652 KB
testcase_07 AC 1,127 ms
82,336 KB
testcase_08 AC 946 ms
78,320 KB
testcase_09 AC 1,104 ms
82,488 KB
testcase_10 AC 1,055 ms
82,152 KB
testcase_11 AC 1,086 ms
82,248 KB
testcase_12 AC 1,083 ms
82,056 KB
testcase_13 AC 1,094 ms
82,260 KB
testcase_14 AC 1,064 ms
82,220 KB
testcase_15 AC 1,047 ms
80,820 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[] x = new int[n];
		for (int i = 0; i < n; i++) {
			x[i] = Integer.parseInt(sa[i]);
		}
		sa = br.readLine().split(" ");
		int[] y = new int[n];
		for (int i = 0; i < n; i++) {
			y[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		int ans = 100000000;
		for (int i = 0; i < n; i++) {
			ans = Math.min(ans, x[i] + y[i]);
		}
		System.out.println(ans);
		System.out.println(0);
		for (int i = 0; i < n; i++) {
			System.out.println(Math.min(x[i], ans));
		}
		System.out.println(ans);
	}
}
0