QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#450910 | #8758. Menji 和 gcd | tarjen# | WA | 222ms | 3708kb | C++20 | 408b | 2024-06-22 19:29:56 | 2024-06-22 19:29:57 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int T;cin>>T;
int ans=1;
while(T--){
int L,R;cin>>L>>R;
for(int i=1;i<=L;){
int r=min(L/(L/i),R/(R/i));
r=min(L,r);
if(R/r-(L-1)/r>=2){
ans=r;
}
i=r+1;
}
cout<<ans<<"\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 33ms
memory: 3708kb
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 7 7 70 126 1754385 5861340682 7007007007
result:
ok 10 numbers
Test #2:
score: -100
Wrong Answer
time: 222ms
memory: 3624kb
input:
6 357134483534 646200407704 504479652692 514965927651 831245941727 837097365832 778543598197 990152196633 19580905336 99295489037 228262697783 935881261360
output:
215400135901 10299318553 5813176151 198030439326 19580905336 228262697783
result:
wrong answer 5th numbers differ - expected: '49647744518', found: '19580905336'