結果
問題 | No.909 たぴの配置 |
ユーザー |
|
提出日時 | 2020-03-28 12:16:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 402 ms / 3,000 ms |
コード長 | 700 bytes |
コンパイル時間 | 1,430 ms |
コンパイル使用メモリ | 163,140 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-02 11:00:42 |
合計ジャッジ時間 | 8,020 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0;i<n;i++)using namespace std;typedef long long ll;typedef pair<int,int> pp;const int INF = 1e9;const int MOD = 1000000007;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 = INF,idx = 0;rep(i,n){if(ans > x[i] + y[i]){idx = i; 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{if(x[i-1] < ans) cout << x[i-1] << endl;else cout << ans << endl;}}return 0;}