結果
問題 |
No.2500 Products in a Range
|
ユーザー |
|
提出日時 | 2023-10-14 16:12:58 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 720 bytes |
コンパイル時間 | 2,940 ms |
コンパイル使用メモリ | 251,328 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-16 10:35:50 |
合計ジャッジ時間 | 5,120 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 48 WA * 13 |
ソースコード
#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()); 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); } for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (l <= 1LL * A[i] * A[j] && 1LL * A[i] * A[j] <= r) { ct = max(ct, 2LL); } } } cout << ct << endl; }