結果
問題 | No.2500 Products in a Range |
ユーザー |
|
提出日時 | 2023-10-13 22:23:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 611 bytes |
コンパイル時間 | 1,763 ms |
コンパイル使用メモリ | 195,672 KB |
最終ジャッジ日時 | 2025-02-17 07:22:39 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 52 WA * 9 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main () {int N;ll L, R;cin >> N >> L >> R;ll A[5050];for (int i = 0; i < N; i ++) cin >> A[i];sort(A, A + N);int ans = 1;for (int l = 0; l < N - 1; l ++) {for (int r = l + 1; r <= N; r ++) {if (r == N) {ans = max(ans, N - l);/*for (int p = l; p < r; p ++) {cout << A[p] << " ";}cout << endl;*/continue;}ll x = A[r] * A[r- 1], y = A[r] * A[l];bool ok = L <= min(x, y) && max(x, y) <= R;if (!ok) {ans = max(ans, r - l);break;}}}cout << ans << endl;}