結果

問題 No.909 たぴの配置
ユーザー chocopuuchocopuu
提出日時 2019-10-19 00:18:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 897 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 167,620 KB
実行使用メモリ 6,260 KB
最終ジャッジ日時 2023-09-08 03:00:17
合計ジャッジ時間 9,622 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 343 ms
5,948 KB
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;i--)
#define FOR(i,s,n) for(int i = s;i < (int)n;i++)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--)
#define ALL(a) a.begin(),a.end()
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a = b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a = b;return true;}return false;}
constexpr long long INF = 1e18;



signed main(){
	int N;
	cin>>N;
	vector<int>tapi(N,INF);
	REP(i,N){
		int t;
		cin >> t;
		CHMIN(tapi[i],t);
	}
	int end = INF;
	vector<int>y(N);
	REP(i,N){
		cin>>y[i];
		CHMIN(end,tapi[i]+y[i]);
	}
	REP(i,N){
		CHMIN(tapi[i],end-y[i]);
	}
	cout<<end<<endl;
	int add = max(0ll,-*min_element(ALL(tapi)));
	cout<<add<<endl;
	for(auto &e:tapi)cout << e+add << endl;
	cout<<end+add<<endl;
}
0