結果
問題 | No.909 たぴの配置 |
ユーザー |
![]() |
提出日時 | 2019-12-06 01:48:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 149 ms / 3,000 ms |
コード長 | 637 bytes |
コンパイル時間 | 1,702 ms |
コンパイル使用メモリ | 166,036 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-12-23 04:46:29 |
合計ジャッジ時間 | 7,475 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;int main() {int N;cin >> N;ll X[N], Y[N];ll x_min = LLONG_MAX;for (int i = 0; i < N; i++) {cin >> X[i];x_min = min(x_min, X[i]);}for (int i = 0; i < N; i++) {cin >> Y[i];}ll d = LLONG_MAX;for (int i = 0; i < N; i++){d = min(d, X[i] + Y[i]);}cout << d << "\n";cout << "0\n";for (int i = 0; i < N; i++) {if (X[i] > d) {cout << d << "\n";} else {cout << X[i] << "\n";}}cout << d << "\n";return 0;}