QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#425529 | #8758. Menji 和 gcd | BYR_KKK | WA | 976ms | 3824kb | C++14 | 339b | 2024-05-30 12:56:25 | 2024-05-30 12:56:25 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
int l,r,T;
signed main(){
std::cin>>T;
while(T--){
std::cin>>l>>r;
int len=r-l+1;
for(int i=len;;i--){
int x=l%i,y=i-x+l;
if(x==0) y=0;
// fprintf(stderr,"i=%lld x=%lld and y=%lld\n",i,x,y);
if(r-y>=i){
printf("%lld\n",i);
break;
}
}
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 976ms
memory: 3824kb
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 3 11 7 70 126 1754385 5861340682 7007007007
result:
wrong answer 4th numbers differ - expected: '7', found: '11'