| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 101305 | wanghetian | 连续非素数的最长度 | C++ | Wrong Answer | 0 | 0 MS | 252 KB | 449 | 2024-09-23 22:07:28 |
#include <bits/stdc++.h> using namespace std; bool isprime(int n){ if(n<=1) return false; for(int i=2;i*i<=n;i++){ if(n%i==0){ return false; } } return true; } int main(){ int n; cin>>n; int sum=0; int ans=0; for(int i=2;i<=n;i++){ if(!isprime(i)) { sum++; } else { ans=max(sum,ans); } } cout<<ans; return 0; }