标签:NPU class nbsp des type ali 结束 include sqrt
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <vector> #include <cmath> #include <queue> #include <deque> #include <cmath> #include <map> using namespace std; typedef long long ll; const double inf=1e20; const int maxn=3000;//>2591 const int mod=1e9+7; int vis[maxn]; int main(){ int n=2900; int m=sqrt(n+0.5); memset(vis,0,sizeof(vis)); for(int i=2;i<=m;i++)if(!vis[i]) for(int j=i*i;j<=n;j+=i)vis[j]=1; int x,y; while(scanf("%d%d",&x,&y)!=EOF){ if(x==y&&x==0)break; int o=1; for(int i=x;i<=y;i++){ if(vis[i*i+i+41]){ o=0; break; } } if(o)printf("OK\n"); else printf("Sorry\n"); } return 0; }
标签:NPU class nbsp des type ali 结束 include sqrt
原文地址:https://www.cnblogs.com/wz-archer/p/12448126.html