結果
| 問題 |
No.2500 Products in a Range
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-13 21:07:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 803 bytes |
| コンパイル時間 | 1,981 ms |
| コンパイル使用メモリ | 196,640 KB |
| 最終ジャッジ日時 | 2025-02-17 06:57:22 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 52 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define SZ(a) ((int)a.size())
#define ALL(v) v.begin(), v.end()
#define pb push_back
ll arr[5005];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int n;
ll l, r;
cin >> n >> l >> r;
for (int i = 1; i <= n; ++i)
cin >> arr[i];
int ans = 1;
sort(arr + 1, arr + n + 1);
auto in_itv = [&](ll x) {
return clamp(x, l, r) == x;
};
for (int i = 1; i <= n; ++i) {
for (int j = i + 1; j <= n; ++j) {
if (in_itv(arr[i] * arr[i + 1]) && in_itv(arr[i] * arr[j]) && in_itv(arr[j - 1] * arr[j]))
ans = max(ans, j - i + 1);
}
}
cout << ans << "\n";
}