結果

問題 No.909 たぴの配置
ユーザー skentagonskentagon
提出日時 2019-10-18 21:54:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 557 bytes
コンパイル時間 3,215 ms
コンパイル使用メモリ 174,496 KB
実行使用メモリ 14,988 KB
最終ジャッジ日時 2023-09-07 22:06:20
合計ジャッジ時間 11,595 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for( int i=0; i<n; ++i )
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<vector<int>> d(n,vector<int>(3));
  vector<int> res(n);
  rep(i,n){ cin >> d[i][0]; }
  rep(i,n){ cin >> d[i][1]; }
  rep(i,n){ d[i][2] = i; }
  sort( d.begin(), d.end(), [](const vector<int>& l, const vector<int>& r){
    return l[0]+l[1] < r[0]+r[1];
  });
  auto ml = (*(d.begin()))[0] + (*(d.begin()))[1];
  cout << ml << endl;
  puts("0");
  rep(i,n){
    cout << min( d[i][0], ml ) << endl;
  }
}
0