Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3693 | 杨洋杰 | 质数的和与积 | C++ | Accepted | 0 MS | 268 KB | 350 | 2024-06-22 18:32:29 |
#include<bits/stdc++.h> using namespace std; int main(){ int s,ma=0; cin>>s; for(int i=2;i<=s;i++){ bool q=1; int k=s-i; for(int j=2;j<=sqrt(i);j++) if(i%j==0){ q=0; break; } for(int j=2;j<=sqrt(k);j++) if(k%j==0){ q=0; break; } if(q) ma=max(ma,k*i); } cout<<ma<<endl; return 0; }