| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 74561 | 石利伟 | 连续非素数的最长度 | C++ | Accepted | 100 | 355 MS | 252 KB | 400 | 2023-05-27 16:29:42 |
#include<bits/stdc++.h> using namespace std; long long c[1000001]; bool pri(long long n){ if(n<2) return false; for(long long i=2;i*i<=n;i++)if(n%i==0) return false; return true; } long long old=2,_max=0,n; int main(){ cin>>n; for(long long i=3; i<=n; i++) { if(pri(i)){ _max=max(_max,i-old-1); old=i; } } if(old!=n)_max=max(_max,n-old); cout<<_max; return 0; }