結果

問題 No.909 たぴの配置
ユーザー ks2m
提出日時 2019-10-18 21:31:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 1,158 ms / 3,000 ms
コード長 804 bytes
コンパイル時間 2,490 ms
コンパイル使用メモリ 76,516 KB
実行使用メモリ 72,844 KB
最終ジャッジ日時 2024-06-25 15:01:55
合計ジャッジ時間 16,696 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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