結果

問題 No.909 たぴの配置
ユーザー ei1333333
提出日時 2019-09-05 00:40:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 372 ms / 3,000 ms
コード長 463 bytes
コンパイル時間 1,801 ms
コンパイル使用メモリ 194,640 KB
最終ジャッジ日時 2025-01-07 16:29:32
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

const int inf = 1 << 30;

int main() {
  int N;
  cin >> N;
  vector< int > X(N), Y(N);
  for(auto &x : X) cin >> x;
  for(auto &y : Y) cin >> y;

  int ret = inf;
  for(int i = 0; i < N; i++) {
    ret = min(ret, X[i] + Y[i]);
  }

  cout << ret << endl;
  cout << 0 << endl;
  for(int i = 0; i < N; i++) {
    int need = X[i] + Y[i] - ret;
    cout << X[i] - min(X[i], need) << endl;
  }
  cout << ret << endl;
}
0