| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 151157 | 陈家宝 | 质数和分解 | C++ | Accepted | 100 | 0 MS | 256 KB | 419 | 2024-06-12 13:32:11 |
#include<bits/stdc++.h> using namespace std; int a[205],f[205],cnt,n; bool sushu(int x){ for (int i = 2;i * i <= x;i++)if (x % i == 0)return false; return true; } int main(){ for (int i = 2;i <= 200;i++) if (sushu(i)){ cnt++; a[cnt] = i; } f[0] = 1; f[1] = 0; for (int i = 1;i <= cnt;i++)for (int j = a[i];j <= 200;j++)f[j] += f[j - a[i]]; while (cin>>n)cout<<f[n]<<endl; return 0; }