結果

問題 No.2500 Products in a Range
ユーザー Yashu KumarYashu Kumar
提出日時 2023-10-13 21:56:30
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 770 bytes
コンパイル時間 3,114 ms
コンパイル使用メモリ 255,356 KB
実行使用メモリ 4,484 KB
最終ジャッジ日時 2023-10-13 21:56:35
合計ジャッジ時間 5,176 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 3 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 3 ms
4,352 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 3 ms
4,352 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 2 ms
4,352 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 1 ms
4,348 KB
testcase_36 AC 1 ms
4,348 KB
testcase_37 AC 1 ms
4,352 KB
testcase_38 AC 1 ms
4,348 KB
testcase_39 AC 1 ms
4,348 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 1 ms
4,348 KB
testcase_43 WA -
testcase_44 AC 1 ms
4,352 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 2 ms
4,352 KB
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 2 ms
4,352 KB
testcase_55 AC 2 ms
4,352 KB
testcase_56 AC 2 ms
4,348 KB
testcase_57 AC 2 ms
4,348 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define int long long
using namespace std;
signed main()	{
  ios_base:: sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  int n, l, r;
  cin >> n >> l >> r;
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  deque<int> q(A.begin(), A.end());
  while (q.size() > 1)  {
    int p1 = q.front();
    q.pop_front();
    int p2 = q.front();
    if (l <= 1LL * p1 * p2 && 1LL * p1 * p2 <= r) {
      q.push_front(p1);
      break;
    }
  }
  while (q.size() > 1)  {
    int p1 = q.back();
    q.pop_back();
    int p2 = q.back();
    if (l <= 1LL * p1 * p2 && 1LL * p1 * p2 <= r) {
      q.push_back(p1);
      break;
    }
  }
  int sz = q.size();
  cout << (sz > 1 ? sz : 0) << endl;
}
0