結果
問題 |
No.2767 Add to Divide
|
ユーザー |
|
提出日時 | 2024-09-04 22:17:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 425 bytes |
コンパイル時間 | 1,927 ms |
コンパイル使用メモリ | 192,516 KB |
最終ジャッジ日時 | 2025-02-24 03:52:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 12 WA * 4 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { int T; cin>>T; while(T--){ int A,B; cin>>A>>B; B-=A; int an=1e9+10; for(int i=1;i*i<=B;i++){ if(B%i==0){ int e=i; if(e>=A)an=min(an,e-A); e=B/i; if(e>=A)an=min(an,e-A); } } cout<<(an<1e9+5?an:-1)<<endl; } }