結果
問題 | No.909 たぴの配置 |
ユーザー |
![]() |
提出日時 | 2019-10-19 18:47:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 380 ms / 3,000 ms |
コード長 | 589 bytes |
コンパイル時間 | 1,538 ms |
コンパイル使用メモリ | 169,872 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 14:46:03 |
合計ジャッジ時間 | 7,708 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){int N; cin >> N;int res=1e8;int x[N+1];int y[N+1];for(int i=1;i<=N;i++){cin >> x[i];}for(int i=1;i<=N;i++){cin >> y[i];}for(int i=1;i<=N;i++){res=min(res,x[i]+y[i]);}vector<int> ans(N+2);ans[0]=0;ans[N+1]=res;for(int i=1;i<=N;i++){if(x[i]>res){ans[i]=res;}else{ans[i]=x[i];}}cout << res << endl;for(int i=0;i<N+2;i++){cout << ans[i] << endl;}}