結果

問題 No.909 たぴの配置
ユーザー sigma425sigma425
提出日時 2019-10-18 21:27:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 51 ms / 3,000 ms
コード長 1,220 bytes
コンパイル時間 2,529 ms
コンパイル使用メモリ 201,572 KB
実行使用メモリ 5,536 KB
最終ジャッジ日時 2023-09-07 21:13:39
合計ジャッジ時間 5,208 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 48 ms
5,452 KB
testcase_06 AC 50 ms
5,536 KB
testcase_07 AC 46 ms
5,144 KB
testcase_08 AC 48 ms
5,456 KB
testcase_09 AC 51 ms
5,388 KB
testcase_10 AC 47 ms
5,128 KB
testcase_11 AC 46 ms
5,188 KB
testcase_12 AC 47 ms
5,364 KB
testcase_13 AC 49 ms
5,400 KB
testcase_14 AC 47 ms
5,200 KB
testcase_15 AC 46 ms
5,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

#ifdef LOCAL
#define show(x) cerr << "LINE" << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define show(x) true
#endif

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);		//DON'T USE scanf/printf/puts !!
	cout << fixed << setprecision(20);
	
	int N; cin >> N;
	V<int> L(N),R(N);
	rep(i,N) cin >> L[i];
	rep(i,N) cin >> R[i];
	V<int> x(N+2);
	int mn = 1e9;
	rep(i,N) chmin(mn,L[i]+R[i]);
	x[N+1] = mn;
	rep1(i,N) x[i] = min(L[i-1],mn);
	cout << mn << endl;
	rep(i,N+2) cout << x[i] << '\n';
}
0