結果

問題 No.2500 Products in a Range
ユーザー Yashu KumarYashu Kumar
提出日時 2023-10-13 22:05:37
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 712 bytes
コンパイル時間 2,876 ms
コンパイル使用メモリ 252,428 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-15 17:47:10
合計ジャッジ時間 4,843 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 10 ms
5,376 KB
testcase_11 AC 12 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 14 ms
5,376 KB
testcase_15 AC 3 ms
5,376 KB
testcase_16 AC 11 ms
5,376 KB
testcase_17 AC 6 ms
5,376 KB
testcase_18 AC 7 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 18 ms
5,376 KB
testcase_23 AC 18 ms
5,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 17 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 5 ms
5,376 KB
testcase_34 AC 11 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 2 ms
5,376 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 3 ms
5,376 KB
testcase_44 AC 4 ms
5,376 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 17 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 2 ms
5,376 KB
testcase_55 AC 7 ms
5,376 KB
testcase_56 AC 8 ms
5,376 KB
testcase_57 AC 15 ms
5,376 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);
  bool isZero = false;
  int ct0 = 0, ct1 = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (A[i] == 0)  {
      isZero = true;
      ++ct0;
    } else  {
      ++ct1;
    }
  }
  sort(A.begin(), A.end());
  int ct = 0;
  for (int i = 0; i + 1 < n; i++) {
    int c = 1;
    for (int j = i + 1; j < n; j++) {
      if (l <= 1LL * A[j - 1] * A[j] && 1LL * A[j - 1] * A[j] <= r) {
        ++c;
      }
    }
    ct = max(ct, c);
  }
  ct = max(ct0 + (ct1 > 0), ct);
  cout << ct << endl;
}
0