Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ISPrime
//g++ 7.4.0 #include <iostream> using namespace std; int IP(int N) { if(N<4)return 1; if((N&1)==0 || N%3==0) return 0; long long i; int d=2; for(i=5;i*i<=N;i+=d,d=6-d) if(N%i==0)return 0; return 1; } int main() { int n; cin>>n; if(IP(n))cout<<"YES"<<endl; else cout<<"NO"<<endl; }
run
|
edit
|
history
|
help
0
DSU on tree (http://codeforces.com/contest/600/problem/E)
GenericPacker
Hello World C++ - minimal
Segmented Sieve
N Queens problem
OperatorOverload
codechef
diamond
Microsoft - MaxEmployeeAttendence (R repititions - DP solution bitmask)
MovConstrAssign4