結果

問題 No.989 N×Mマス計算(K以上)
ユーザー kyo1
提出日時 2020-11-03 01:05:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 199,020 KB
最終ジャッジ日時 2025-01-15 19:13:06
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, M;
  cin >> N >> M;
  int64_t K;
  cin >> K;
  char op;
  cin >> op;
  vector<int64_t> B(M);
  for (auto&& e : B) {
    cin >> e;
  }
  sort(B.begin(), B.end());
  int64_t res = 0;
  for (int i = 0; i < N; i++) {
    int64_t a;
    cin >> a;
    int64_t x = K;
    if (op == '+') {
      x -= a;
    } else {
      x /= a;
    }
    int p = lower_bound(B.begin(), B.end(), x) - B.begin();
    res += M - p;
  }
  cout << res << '\n';
  return 0;
}
0