結果

問題 No.909 たぴの配置
ユーザー ei1333333ei1333333
提出日時 2019-09-05 00:40:11
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 376 ms / 3,000 ms
コード長 463 bytes
コンパイル時間 2,350 ms
コンパイル使用メモリ 200,968 KB
実行使用メモリ 4,736 KB
最終ジャッジ日時 2023-09-07 20:45:07
合計ジャッジ時間 10,049 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,508 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,388 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 363 ms
4,736 KB
testcase_06 AC 368 ms
4,684 KB
testcase_07 AC 346 ms
4,376 KB
testcase_08 AC 364 ms
4,736 KB
testcase_09 AC 376 ms
4,572 KB
testcase_10 AC 354 ms
4,476 KB
testcase_11 AC 343 ms
4,384 KB
testcase_12 AC 361 ms
4,692 KB
testcase_13 AC 372 ms
4,688 KB
testcase_14 AC 348 ms
4,480 KB
testcase_15 AC 347 ms
4,416 KB
権限があれば一括ダウンロードができます

ソースコード

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