結果

問題 No.909 たぴの配置
ユーザー bonKotsu
提出日時 2021-12-03 00:49:21
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 408 ms / 3,000 ms
コード長 665 bytes
コンパイル時間 4,286 ms
コンパイル使用メモリ 251,492 KB
最終ジャッジ日時 2025-01-26 03:02:04
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;

#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>
#define LP pair<ll, ll>


int main() {
  int n;
  cin >> n;
  vector<int> x(n), y(n);
  rep(i,n) cin >> x[i];
  rep(i,n) cin >> y[i];
  const int INF = 1001001001;
  int mx = INF;
  rep(i,n) mx = min(mx, x[i]+y[i]);
  cout << mx << endl;
  cout << 0 << endl; // たぴ0
  rep(i,n) {
    if (x[i] >= mx) {
      cout << mx << endl;
    } else if (y[i] >= mx) {
      cout << 0 << endl;
    } else {
      cout << x[i] << endl;
    }
  }
  cout << mx << endl; // たぴn+1

  
}
0