結果

問題 No.909 たぴの配置
ユーザー QCFiumQCFium
提出日時 2019-10-18 21:30:35
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 66 ms / 3,000 ms
コード長 493 bytes
コンパイル時間 1,780 ms
コンパイル使用メモリ 167,644 KB
実行使用メモリ 5,740 KB
最終ジャッジ日時 2023-09-07 21:21:22
合計ジャッジ時間 5,253 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 64 ms
5,700 KB
testcase_06 AC 66 ms
5,732 KB
testcase_07 AC 60 ms
5,576 KB
testcase_08 AC 63 ms
5,628 KB
testcase_09 AC 65 ms
5,644 KB
testcase_10 AC 59 ms
5,524 KB
testcase_11 AC 60 ms
5,512 KB
testcase_12 AC 65 ms
5,644 KB
testcase_13 AC 66 ms
5,740 KB
testcase_14 AC 60 ms
5,516 KB
testcase_15 AC 60 ms
5,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int n = ri();
	std::vector<int> res{0};
	int min = 1000000000;
	int x[n], y[n];
	for (int i = 0; i < n; i++) x[i] = ri();
	for (int i = 0; i < n; i++) y[i] = ri();
	for (int i = 0; i < n; i++)
		min = std::min(min, x[i] + y[i]);
	for (int i = 0; i < n; i++)
		res.push_back(x[i] - y[i] > min ? min : x[i]);
	res.push_back(min);
	printf("%d\n", min);
	for (auto i : res) printf("%d\n", i);
	return 0;
}
0