| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 20018 | 陈路垚 | H数 | C++ | Accepted | 100 | 0 MS | 332 KB | 412 | 2021-05-27 21:56:30 |
#include<iostream> #include<cstdio> using namespace std; int main() { int i,j,n,p[10]={0}; long long min,h[10010]={0},s[10]={0,2,3,5,7}; cin>>n; h[1]=1; for(i=1;i<=4;++i)p[i]=1; for(i=2;i<=n+1;++i){ min=h[p[1]]*s[1]; for(j=2;j<=4;++j) if(h[p[j]]*s[j]<min) min=h[p[j]]*s[j]; h[i]=min; for(j=1;j<=4;++j) if(h[p[j]]*s[j]==min)p[j]++; } cout<<h[n+1]<<endl; return 0; }