| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 101581 | zhouyuchen | 连续非素数的最长度 | C++ | Accepted | 100 | 104 MS | 248 KB | 392 | 2024-10-07 16:18:46 |
#include<bits/stdc++.h> using namespace std; int a,maxx,cnt; int isprime(int a){ int f; if(a==1||a==0){ return 1; } if(a==2){ return 0; } for(int i=2;i<=a/i;i++){ if(a%i==0){ return 1; } } return 0; } int main(){ cin>>a; while(a--){ if(isprime(a)){ cnt++; } else{ maxx=max(maxx,cnt); cnt=0; } } cout<<maxx; return 0; }