Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
145476 吴宗桦 质数和分解 C++ 运行出错 0 0 MS 96 KB 457 2024-05-05 09:43:42

Tests(0/10):


#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; }


测评信息: