結果

問題 No.909 たぴの配置
ユーザー m1025o1184tm1025o1184t
提出日時 2019-11-21 21:22:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 318 ms / 3,000 ms
コード長 625 bytes
コンパイル時間 1,599 ms
コンパイル使用メモリ 169,656 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 08:45:19
合計ジャッジ時間 7,261 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 302 ms
6,944 KB
testcase_06 AC 310 ms
6,940 KB
testcase_07 AC 290 ms
6,944 KB
testcase_08 AC 306 ms
6,944 KB
testcase_09 AC 318 ms
6,940 KB
testcase_10 AC 291 ms
6,944 KB
testcase_11 AC 285 ms
6,940 KB
testcase_12 AC 300 ms
6,940 KB
testcase_13 AC 312 ms
6,940 KB
testcase_14 AC 277 ms
6,940 KB
testcase_15 AC 285 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> X(n); vector<int> Y(n);
	vector<int> res(n);
	rep(i, n) {
		cin >> X[i];
	}
	rep(i, n) {
		cin >> Y[i];
		res[i] = X[i] + Y[i];
	}
	vector<int> anstapi(n + 2);
	sort(all(res));
	anstapi[0] = 0;
	for (int i = 1; i < n + 1; ++i) {
		anstapi[i] = min(res[0], X[i - 1]);
	}
	anstapi[n + 1] = res[0];
	cout << anstapi[n + 1] << endl;
	rep(i, n + 2) {
		cout << anstapi[i] << endl;
	}
	return 0;
}
0