結果

問題 No.909 たぴの配置
コンテスト
ユーザー ei1333333
提出日時 2019-09-05 00:40:11
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 465 ms / 3,000 ms
+ 170µs
コード長 463 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,447 ms
コンパイル使用メモリ 217,280 KB
実行使用メモリ 9,928 KB
最終ジャッジ日時 2026-11-17 00:45:10
合計ジャッジ時間 9,976 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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