POJ-2591
来源:互联网 发布:php assumed 编辑:程序博客网 时间:2024/06/05 20:34
#include<iostream>#include<memory.h>using namespace std;#define MAX 10000000int array[MAX];int main(int argc, char *argv[]){memset(array,0,sizeof(array));int index2=0;int index3=0;array[0]=1;for(int i=1;i<MAX;i++){int t2=2*array[index2]+1;int t3=3*array[index3]+1;int t=t2<t3?t2:t3;if(t2<t3){index2++;}else if(t3<t2){index3++;}else{index2++;index3++;}if(t!=array[i-1]){array[i]=t;}}int index;while(cin>>index){cout<<array[index-1]<<endl;}return 0;}
0 0
- poj 2591
- poj-2591
- POJ-2591
- POJ 2591 Set Definition
- POJ 2591 Set Definition
- poj 2591 Set Definition
- poj 2591,1338 DP
- POJ 2591 解题报告
- poj 2591 Set Definition
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- 机器学习与大数据-2015年夏季百题讲座
- sicily 1141. 猴子的争斗
- Linux 下Ftp的搭建
- 一种用于在线客服系统的主动交互数据处理方法
- HTTP协议详解
- POJ-2591
- 期刊缩写名大全!权威
- 云服务中IaaS, PaaS和SaaS概念及其区别
- 国民经济行业分类与代码(GB/4754-2011)
- Https和SSL
- Linux 搭建vsftpd服务器-实战操作
- 关于C语言多文件编写的一点小小总结
- Quartz Cron常用表达式
- unity3d问题集 <3> 对Physics.Raycast和Ray(射线)的理解