2 条题解
-
0
因为此题解中写道:
由 ,可知答案不大于 ,暴力即可。
所以,我们直接按题意模拟即可。
AC code:
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; for (int t = 1; t <= T; t++) { int n; cin >> n; int ans = 2; for (; __gcd(ans, n) > 1; ans++) { if (__gcd(ans, n) == 1) { break; } } cout << ans << endl; } return 0; }
- 1
信息
- ID
- 115
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 2
- 标签
- 递交数
- 7
- 已通过
- 3
- 上传者