32 条题解
-
0
- #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 5; bool f(int n) { for(int i = 3 ; i * i <= n ; i += 2) { if(n % i == 0) return false; } return true; } int main() { int n; cin >> n; bool flag = true; for(int i = 3; i + 2 <= n ; i += 2) { if(f(i) && f(i + 2)) { flag = false; cout << i << " " << i + 2 << endl; } } if(flag) cout << "empty"; return 0; }
信息
- ID
- 946
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- (无)
- 递交数
- 1556
- 已通过
- 434
- 上传者