热搜:蛋仔派对官服版 大话诛仙bt版 懒人听书正式版 mm131纯净版 美剧鸟破解版
时间:2022-04-30 20:38
枚举每个数的因子,然后该因子数量+1,最后扫描一遍,如果该因子数量小于等于m且该因子在1-n之间就输出
复杂度:枚举因子:O(n^1/2*m) 输出答案 : 大概是O(m*?) 一个不知道的数字
#include #include #include #define pt map::iterator using namespace std; mapmp; mapcnt; int a[100010],tot[100010]; int main() { int n,m; scanf("%d%d",&n,&m); for(int i=1;i<=m;i++) scanf("%d",&a[i]); for(int i=1;i<=m;i++) { mp.clear(); for(int j=1;j*j<=a[i];j++) if(a[i]%j==0) mp[j]=mp[a[i]/j]=1; for(pt it=mp.begin();it!=mp.end();it++) cnt[it->first]++; } tot[0]=n; for(pt it=cnt.begin();it!=cnt.end();it++) { if(it->first<=n) tot[0]--; if(it->second<=m&&it->first<=n) tot[it->second]++; } for(int i=0;i<=m;i++) printf("%d\n",tot[i]); return 0; }
< 跨域问题的产生及解决方法
HDU3038 How Many Answers Are Wrong[带权并查集] >
飞豆微信多开助手 V2.0.0 官方安装版
2024-08-13
亚熙专属骂人工具 V1.0 绿色版
迈迪通2018 V2.2.23 电脑版
2024-07-31
Whalebird V2.5.3 绿色免费版
Teampel(团队协作软件) V5.0.92 多国语言安装版
2024-06-26
东方秀 V1.0 免费安装版
OI语音 V1.1 官方安装版
2024-06-06
TQ云呼叫中心 V9.48.0 官方安装版
火信 V1.3.8 官方安装版
2024-04-08
百玲语音智能聊天机器人 V1.0 绿色版
视酷即时通讯 V2.5 官方安装版
106短信群发平台 V1.0 绿色版
2024-04-01
帮我吧服务管理平台(帮我吧客户端) V5.3.7.0 官方安装版
南山对讲 V1.0.2 绿色版
2024-03-18
Zoom视频会议 V5.13.7.12602 官方安装版
可访 V2.2.55 官方安装版
2024-02-22
版本:v1.0
大小:12.32MB
日期:2024-08-30
版本:v2.4.01
大小:11.5MB
版本:v2.8.9
大小:46.38MB
版本:v1.1.1202.9900
大小:1.88MB
版本:v2.1.3
大小:12.12MB
版本:v1.5.26
大小:37.78MB
版本:v1.17
大小:134.76MB
版本:v9.3.2
大小:141.12MB
版本:v2.4.03
大小:70.40MB
版本:v1.40
大小:28.01MB
版本:v1.0.40.40
大小:956.61MB
版本:v0.5
大小:171.91MB