結果
| 問題 | No.3253 Banned Product |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-11-22 04:03:00 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 781µs | |
| コード長 | 638 bytes |
| 記録 | |
| コンパイル時間 | 451 ms |
| コンパイル使用メモリ | 83,168 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-11-22 04:03:03 |
| 合計ジャッジ時間 | 2,139 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
#include <iostream>
using namespace std;
bool isGood(long long x, long long k) {
for (long long a = 1; a * a <= x; a++) {
if (x % a == 0) {
long long b = x / a;
if (a <= k && b <= k) {
return false;
}
}
}
return true;
}
int main() {
int t;
cin >> t;
while (t--) {
long long n, k;
cin >> n >> k;
long long ans = -1;
for (long long x = n; x > k; x--) {
if (isGood(x, k)) {
ans = x;
break;
}
}
cout << ans << endl;
}
return 0;
}
vjudge1