結果

問題 No.2770 Coupon Optimization
ユーザー haihamabossuhaihamabossu
提出日時 2024-05-31 23:40:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 251 ms / 3,000 ms
コード長 651 bytes
コンパイル時間 3,627 ms
コンパイル使用メモリ 237,184 KB
実行使用メモリ 22,964 KB
最終ジャッジ日時 2024-05-31 23:40:57
合計ジャッジ時間 9,011 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 214 ms
22,920 KB
testcase_04 AC 226 ms
22,952 KB
testcase_05 AC 31 ms
11,088 KB
testcase_06 AC 231 ms
22,948 KB
testcase_07 AC 220 ms
22,796 KB
testcase_08 AC 243 ms
22,948 KB
testcase_09 AC 104 ms
11,540 KB
testcase_10 AC 114 ms
12,728 KB
testcase_11 AC 102 ms
11,128 KB
testcase_12 AC 206 ms
16,080 KB
testcase_13 AC 120 ms
12,664 KB
testcase_14 AC 240 ms
22,836 KB
testcase_15 AC 242 ms
22,952 KB
testcase_16 AC 251 ms
22,964 KB
testcase_17 AC 245 ms
22,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/convolution>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

void solve() {
  ll n, m;
  cin >> n >> m;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  vector<ll> b(m);
  rep(i, m) cin >> b[i], b[i] = 100 - b[i];
  while (ll(b.size()) < n)
    b.push_back(100);
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  auto ans = atcoder::convolution_ll(a, b);
  rep(i, n) cout << ans[i] / 100 << '\n';
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  int T = 1;
  for (int t = 0; t < T; t++) {
    solve();
  }
  return 0;
}
0