为什么超时

nfxx59 2025-10-28 7:55:49 5

#include using namespace std; int main(){ int n;cin>>n;int j=0; for(int i=1;i<=sqrt(n);i++){ if(n%i==0) j++;

}
if(j==1) cout<<"Yes"; else cout<<"No";
return 0; }

{{ vote && vote.total.up }}

共 4 条回复

nfxx59

bu拼好签了

wc022 CSP-J2二等

@nfxx59

你这个性签名我可以说是:“拼好签”里面还有我的部分个性签名

wc022 CSP-J2二等

@nfxx59

第一行就错了,你要写完整,只有“#include”会报错,这里我用万能头文件给你补齐:“#include <bits/stdc++.h>”

root 站长

你这个是编译错误,sqrt 函数要在加一个 cmath 头文件