初级光能
我235个,不多。
(严禁瞎编)
王志成在2024-03-28 19:56:31追加了内容
//埃氏筛 100分解法
#include <iostream>
#include <cstdio>
using namespace std;
const int N=1000005;
int n,f[N],cnt[N];
bool isprimes[N];
int primes[N],pn;
void fastPrimes(int n){//线性筛
isprimes[0]=isprimes[1]=true;
for(int i=2;i<=n;i++){
if(!isprimes[i]) primes[++pn]=i;
for(int j=1;i*primes[j]<=n;j++){
isprimes[i*primes[j]]=true;
if(i%primes[j]==0) break;
}
}
}
int main()
{
scanf("%d",&n);
int maxv=0,x;
for(int i=1;i<=n;i++){
scanf("%d",&x);
maxv=max(maxv,x);
cnt[x]++;
}
fastPrimes(maxv);
f[maxv]=cnt[maxv];
int ans=f[maxv];
for(int i=maxv-1;i>=1;i--){
//if(cnt[i]==0) continue;
f[i]=cnt[i];
for(int j=1;j<=pn&&primes[j]*i<=maxv;j++){
f[i]=max(f[i],cnt[i]+f[primes[j]*i]);
ans=max(ans,f[i]);
}
}
printf("%d\n",ans);
return 0;
}
王志成在2024-03-28 20:03:31追加了内容
啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊!一不小心发错啦!!!!!!
关于学好OI的一些参考书籍:
第一阶段:
《信息学奥赛一本通》
《信息学分析讲义》
第二阶段:
《教你怎么不生气》
《佛经》
《老子》
《沉默的愤怒》
第三阶段:
《颈椎病康复指南》
《腰椎间盘突出日常护理》
《心脏病的预防与防治》
《高血压降压宝典》
《强迫症的自我恢复》
《精神病症状学》
第四阶段:
《活着》
一位聪明的学生: 啦啦啦,啦啦啦,我是刷题的小行家。 再难的题目也不怕。 看题解,抄代码。 今天的教练没吃药, 感觉自己,感觉自己萌萌哒!
啦啦啦,啦啦啦,我是考试的小行家。 在坑的试卷也不怕。 带U盘,上网查。 今天的考官没吃药, 感觉自己,感觉自己萌萌哒!
啦啦啦,我是作弊的小行家。 再狠的老师也不怕。 带资料,抄学霸。 今天的自己没吃药, 感觉自己,感觉自己萌萌哒!
更聪明的学生: 一天地理老师问:同学们,河水向哪里流呀?一学生猛站起来唱到:大河向东流啊。
老师没理会他,接着说:天上有 多少颗星星啊?那位同学又唱到:天上的星星参北斗啊。
老师气急:你给我滚出去!学生:说走咱就走啊。老师无奈说:你有病吧?学生:你有我有全都有啊!
老师:你再说一句试试…学生:路见不平一声吼啊!老师:你信不信我揍你?学生:该出手时就出手…
老师怒:我让你退学!学生:风风火火闯九州!…
老师们回头干嘛呢? 语文老师一回头, 鲁迅甘为孺子牛;
数学老师一回头, 六元六次都能求;
英语老师一回头, Sorry加上三克油;
物理老师一回头, 一根杠杆撬地球;
化学老师一回头, 二氧化碳变汽油;
劳动老师一回头, 破铜烂铁来走秀;
体育老师一回头, 黛玉也能踢足球;
政治老师一回头, 全班同学都梦游;
美术老师一回头, 蒙娜丽莎也风流;
音乐老师一回头, 贝多芬呀也不牛;
信息老师一回头, 带着学生玩网游;
让你知道学生的威力 班长说:走,我们去炸了学校。
副班长说:这个主意不错
化学课代表负责提取氢气
物理课代表负责拼装氢弹
数学课代表负责计算爆破面积
地理课代表负责策划爆破地点
历史课代表负责记录光辉场面
生物课代表负责事后生态环境
政治课代表负责使用法律打官司
语文课代表负责乱写文章推卸责任
英语课代表负责到外国购买进口材料
体育课代表负责屠杀XXX
问一个问题 我是新人,刚学OI,请问可持久化非确定状态AC自动分块维护线段平衡仙人掌优化最小费用最大流预处理混合图上莫比乌斯反演莫队带花舞蹈链并查集树状数组套主席树预处理动态DP分治FFT求多项式逆元对数函数的指数函数用可持久化并查集合并最小费用循环流上插头DP怎么写?
上帝也不是万能的 有一天我遇到了上帝,他满足我个愿望。
我说:“希望世界和平。”
上帝说:“这需要人们的奋斗,我不能帮你……”
我说:“让我获得NOIP,NOI,CTSC和CCPC一等奖,这个可以吧。”
上帝:“好了我马上就让世界和平……”
关于OJ测评结果的解释 AC=Answer Coarse=粗劣的答案
WA=Wonderful Answer=好答案
TLE=Time Limit Enough=时间充裕
MLE=Memory Limit Enough=内存充裕
CE=Compile Easily=轻松通过编译
RE=Run Excellently=完美运行
新手守护
额.........................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
.............................................................................................................................................................................................................................................................
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................245