QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#761343 | #8758. Menji 和 gcd | zshh | WA | 2ms | 3596kb | C++14 | 496b | 2024-11-18 22:13:31 | 2024-11-18 22:13:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
void solve(){
ll res = 0;
int L, R;
cin >> L >> R;
res = 1;
for(int i = 2; i * i <= R; i++){
int gcd = R / i;
if((i - 1) * gcd >= L) res = max(res, gcd);
}
cout << res << '\n';
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3596kb
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 1 70 126 1754385 5861340682 7007007007
result:
wrong answer 5th numbers differ - expected: '7', found: '1'