【hdu 1058】Humble Numbers
来源:互联网 发布:剑三成女脸型数据下载 编辑:程序博客网 时间:2024/05/24 23:11
只想说一句,只是在考英语吗?
#include<cstdio>#include<cstring>#include<iostream>#include<queue>#define LL long longusing namespace std;int n,cnt;LL f[5865];LL cur[]={0,2,3,5,7};priority_queue<LL,vector<LL>,greater<LL> >q;void solve(){int last=0;q.push(1);while(cnt<5842){if(q.top() == last){q.pop() ;continue;}f[++cnt]=q.top();q.pop();for(int i=1;i<=4;i++)q.push(cur[i]*f[cnt]);last=f[cnt];}}int main(){solve();while(scanf("%d",&n)&&n){if(n%10==1&&n%100!=11)printf("The %dst humble number is %d.\n",n,f[n]);else if(n%10==2&&n%100!=12)printf("The %dnd humble number is %d.\n",n,f[n]);else if(n%10==3&&n%100!=13)printf("The %drd humble number is %d.\n",n,f[n]);else printf("The %dth humble number is %d.\n",n,f[n]);}return 0;}
0 0
- HDU 1058 Humble Numbers
- hdu 1058 Humble Numbers
- hdu 1058 Humble Numbers
- HDU 1058 Humble Numbers
- hdu 1058 Humble Numbers
- HDU 1058 Humble Numbers
- hdu 1058 humble numbers
- hdu 1058 Humble Numbers
- hdu 1058 Humble Numbers
- HDU 1058 Humble Numbers
- HDU 1058 Humble Numbers
- HDU 1058 Humble Numbers
- hdu 1058 Humble Numbers
- HDU-1058 Humble Numbers
- hdu 1058 Humble Numbers
- HDU 1058 Humble Numbers
- HDU 1058 Humble Numbers
- hdu 1058 Humble Numbers
- opengl基础画点
- cuda《学习笔记一》——查询属性
- Shader特效——“雪花飞舞 ”的实现 【GLSL】
- 使用BMap.Autocomplete,如何设置下拉框字体的大小
- Hadoop 伪分布式配置
- 【hdu 1058】Humble Numbers
- Android 应用程序启动过程分析 (用SysTrace 跟踪分析)
- 王小草【深度学习】笔记第二弹--细说卷积神经网络
- Android eclipse中项目调试
- 洛谷 1265
- netty 对 http 的实现
- 程序员在上海之四
- 在windows下打出tar.gz的尝试
- SQL