POJ 2591
#include<iostream>
#include<stdio.h>
#define MAXN 10000001
using namespace std; int a[MAXN];
void give_set();
int min(int i,int j);
int main()
{
//freopen("acm.acm","r",stdin);
give_set();
int num;
while(cin>>num)
{
cout<<a[num-]<<endl;
}
} void give_set()
{
a[] = ;
int m;
int len = ;
int x;
int y;
x = ;
y = ;
while(len < MAXN)
{
m = min(*a[x]+,*a[y]+);
if(m == *a[x]+)
++ x;
if(m == *a[y]+)
++ y;
a[len++] = m;
}
}
int min(int a,int b)
{
return a < b ? a : b;
}
POJ 2591的更多相关文章
- POJ 2591 1338 2545 2247(数列递归衍生问题,思路挺妙)
四道题的难度: 2591<1338<2545<2247 POJ 2591 Set Definition: 这是从discuss里看来的,写的挺好,直接copy,根据我的代码稍有改动( ...
- poj 2591 Set Definition
题目 这道题是个水题,写博客上的人好像都不屑于写这这道题.但是我为什么还是觉得挺难的呢? 我也是看了别人的博客才过了的,感觉这种写法很新颖,这样就可以不用在排序了. 下面给出正解: #include& ...
- POJ 2545+2591+2247+1338简单水题
[题意简述]:就是有这种一个序列.就拿当p1 = 2,p2 = 3, p3 = 5,来举例.由这三个数为基准组成的序列是: 2,3,4,5,6,8,9,10,12--如今给你这个序列数组的下标,让你求 ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
随机推荐
- c# 文件笔记
1.文件属性操作 File类与FileInfo都能实现.静态方法与实例化方法的区别! //use File class Console.WriteLine(File.GetAttributes(fil ...
- nigos core 安装配置
系统环境 Apache PHP GCC compiler GD development libraries 环境安装 yum install ...
- asp.net 多线程
//开启一条线程并执行一个方法 Thread oThread = new Thread(new ThreadStart(IIMsSqlToSqlitle2)); oTh ...
- sublime text2一些使用技巧+插件
一.前言 作为一个前端,有一款好的开发利器是必不可少的,editplus.notepad++都是不错的工具,体积轻巧,启动迅速(dw太浮肿了).最近,又有一款新的编辑器诞生,席卷前端界,惹得无数喜爱, ...
- linux上搭建solr(用tomcat部署)
环境centos7 及最新版本solr7 1.先在/usr/local下mkdir solr 2.在里面新建一个tomcat目录 3.拷贝已经解压的tomat到/usr/local/solr/tomc ...
- VHDL基础2
Signals & Variables VHDL 提供了 signal 和 variable 两种对象来处理非静态数据:提供了 constant 和 generic 来处理静态数据. cons ...
- 25个Linux相关的网站
下面是25个最具有影响力,也是最重要的Linux网站,这些网站提供了Linux的分发包,软件,文件,新闻,以及其它所有的关于Linux的东西.关于Linux的分发包历史,可以看看本站的这篇文章< ...
- Write Markdown Syntax Online Document with Sphinx and Pandoc
There is no doubt that we have to write doc while we are developing software. But How do you write d ...
- Java Applet在IE中浏览
1. IE --> 工具 --> Internet选项 --> 取消“将Java1.6.0.4加入Internet”选择项. 2. 开始 --> 控制面板 --> Jav ...
- http基本概念