結果
問題 | No.909 たぴの配置 |
ユーザー |
![]() |
提出日時 | 2019-10-18 21:38:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 292 ms / 3,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 1,783 ms |
コンパイル使用メモリ | 168,404 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-06-25 15:13:32 |
合計ジャッジ時間 | 7,107 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>#define int long longusing namespace std;template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }template<class T>bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }signed main(){cin.tie(0);ios::sync_with_stdio(false);int N; cin>>N;vector<int> x(N),y(N);int ans=1e18;for(int i=0;i<N;i++) cin>>x[i];for(int i=0;i<N;i++) cin>>y[i];for(int i=0;i<N;i++) chmin(ans,x[i]+y[i]);cout<<ans<<endl;cout<<0<<endl;for(int i=0;i<N;i++) cout<<min(ans,x[i])<<endl;cout<<ans<<endl;return 0;}