結果
| 問題 |
No.909 たぴの配置
|
| コンテスト | |
| ユーザー |
minato
|
| 提出日時 | 2019-12-14 10:47:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 290 ms / 3,000 ms |
| コード長 | 995 bytes |
| コンパイル時間 | 2,261 ms |
| コンパイル使用メモリ | 179,544 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 03:06:21 |
| 合計ジャッジ時間 | 8,573 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
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;
}
///////////////////////////////////////////////////////////////
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr); //入出力高速化
int N; cin >> N;
vector<int> X(N),Y(N);
rep(i,N) cin >> X[i];
rep(i,N) cin >> Y[i];
int ans = INF;
rep(i,N) chmin(ans,X[i] + Y[i]);
cout << ans << endl;
rep(i,N+2) {
if (i == 0) cout << 0 << endl;
else if (i == N+1) cout << ans << endl;
else cout << min(ans,X[i-1]) << endl;
}
}
minato