Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46958 | 老方 | 质因数的个数 | C++ | Accepted | 0 MS | 260 KB | 368 | 2024-05-07 21:34:56 |
#include<bits/stdc++.h> using namespace std; int b[100001]={2,3,5,7,11,13,17,19, 23,29,31,37,41,43,47,53,59,61,67,71, 73,79,83,89,97}; int main(){ int a,r; cin>>a>>r; int maxn=-1; for(int i=a;i<=r;i++){ int t=i,s=0; for(int j=0;j<25;j++){ while(t%b[j]==0){ s++; t/=b[j]; } } maxn=max(maxn,s); } cout<<maxn; return 0; }