結果
| 問題 | No.3253 Banned Product |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-11-20 22:39:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 812 bytes |
| コンパイル時間 | 1,916 ms |
| コンパイル使用メモリ | 194,364 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-11-20 22:39:22 |
| 合計ジャッジ時間 | 2,615 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 1 WA * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t;
while(t--) {
ll n, k;
cin >> n >> k;
if(n == k) {
cout << "-1\n";
continue;
}
ll cur = n;
while(true) {
if(cur <= k) {
cout << "-1\n";
break;
}
bool bad = false;
for(ll i = 2; i * i <= cur; i++) {
if(cur % i == 0) {
bad = true;
break;
}
}
if(!bad || (cur > 1 && cur > k)) {
cout << cur << "\n";
break;
}
cur--;
}
}
}
vjudge1