結果
| 問題 |
No.2500 Products in a Range
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-13 22:03:41 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 566 bytes |
| コンパイル時間 | 2,835 ms |
| コンパイル使用メモリ | 250,292 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 17:45:16 |
| 合計ジャッジ時間 | 4,705 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 39 WA * 22 |
ソースコード
#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;
for (int i = 0; i < n; i++) {
cin >> A[i];
}
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);
}
cout << ct << endl;
}