結果

問題 No.909 たぴの配置
ユーザー iqueue02iqueue02
提出日時 2019-10-18 23:29:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 369 ms / 3,000 ms
コード長 558 bytes
コンパイル時間 1,505 ms
コンパイル使用メモリ 166,844 KB
実行使用メモリ 4,704 KB
最終ジャッジ日時 2023-09-08 02:47:06
合計ジャッジ時間 7,887 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 360 ms
4,528 KB
testcase_06 AC 359 ms
4,584 KB
testcase_07 AC 337 ms
4,504 KB
testcase_08 AC 357 ms
4,640 KB
testcase_09 AC 369 ms
4,584 KB
testcase_10 AC 332 ms
4,380 KB
testcase_11 AC 336 ms
4,432 KB
testcase_12 AC 342 ms
4,584 KB
testcase_13 AC 360 ms
4,704 KB
testcase_14 AC 341 ms
4,440 KB
testcase_15 AC 336 ms
4,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

const int INF = 1e9;

int main(){
  int n;
  cin >> n;
  vector<int> x(n),y(n);
  int d = INF;
  rep(i,n) cin >> x[i];
  rep(i,n) cin >> y[i];

  rep(i,n) d = min(d,x[i] + y[i]);
  cout << d << endl;
  cout << 0 << endl;
  rep(i,n) {
    if (x[i] <= d) cout << x[i] << endl;
    else if (y[i] <= d) cout << d - y[i] << endl;
    else cout << d << endl;
  }
  cout << d << endl;
  return 0;
}
0