結果
問題 | No.909 たぴの配置 |
ユーザー |
![]() |
提出日時 | 2019-10-18 23:29:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 387 ms / 3,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 1,599 ms |
コンパイル使用メモリ | 168,768 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 19:55:21 |
合計ジャッジ時間 | 7,796 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i,n) for(int i = 0; i < (n);i++)#define sz(x) int(x.size())typedef long long ll;typedef pair<int,int> P;const int INF = 1e9;int main(){int n;cin >> n;vector<int> x(n),y(n);int d = INF;rep(i,n) cin >> x[i];rep(i,n) cin >> y[i];rep(i,n) d = min(d,x[i] + y[i]);cout << d << endl;cout << 0 << endl;rep(i,n) {if (x[i] <= d) cout << x[i] << endl;else if (y[i] <= d) cout << d - y[i] << endl;else cout << d << endl;}cout << d << endl;return 0;}