QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#439671 | #8758. Menji 和 gcd | ship2077 | WA | 32ms | 3832kb | C++14 | 397b | 2024-06-12 15:50:26 | 2024-06-12 15:50:28 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
void solve(){ int L,R,ans=0;
cin>>L>>R;L--;
if (R/2>=L) return printf("%lld\n",R/2),void();
for (int l=1,r;l<=R-L;l=r+1){
r=min(R/(R/l),L/(L/l));
if (R/r-L/r>1) ans=r;
}
printf("%lld\n",ans);
}
signed main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int T;cin>>T;while (T--) solve(); return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 32ms
memory: 3832kb
input:
10 1 2 2 4 6 10 11 21 147 154 1470 1540 2890 3028 998244353 1000000007 34827364537 41029384775 147147147147 154154154154
output:
1 2 5 10 7 70 126 1754385 5861340682 7007007007
result:
wrong answer 3rd numbers differ - expected: '3', found: '5'