結果
問題 | No.909 たぴの配置 |
ユーザー |
![]() |
提出日時 | 2019-10-18 21:27:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 381 ms / 3,000 ms |
コード長 | 528 bytes |
コンパイル時間 | 1,615 ms |
コンパイル使用メモリ | 168,324 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 14:53:00 |
合計ジャッジ時間 | 7,653 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>#define rep(i, n) for(int i = 0; i < (int)n; i++)using namespace std;using ll = long long;int main() {int n;cin >> n;vector<int> x(n), y(n);rep(i, n) cin >> x[i];rep(i, n) cin >> y[i];int ans = x[0] + y[0];rep(i, n) {ans = min(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(x[i - 1], ans) << endl;}return 0;}