提交时间:2024-05-05 09:43:42
运行 ID: 145476
#include<iostream> #include<cmath> #include<cstdio> #include <bits/stdc++.h> using namespace std; int a,b[200],c,d[114514190],e,f,g,h,i,j,k; bool o[10004]; int main() { memset(o,true,sizeof(o)); c=0; for(e=2;e<=200;e++) if(o[e]==1) { b[++c]=e; for(f=e*e;f<=200;f+=e) o[f]=0; } cin>>a; memset(d,0,sizeof(d)); d[0]=1; for(e=1;e<=c;e++) for(f=b[e];f<=a;f++) d[f]+=d[f-b[e]]; cout<<d[a]<<endl; return 0; }