8907: 幸运数

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:9 通过:2

题目描述

十进制数字中,只含有 6 与 8 的数字被称作幸运数。将所有的幸运数从小到大排序,第一个幸运数是 6,接下来是8,66,68,86,88,  …给定 n,请输出第 n 个幸运数。


输入格式

单个整数:表示 lns="http://www.w3.org/1998/Math/MathML">
n

输出格式

单个整数:表示第 lns="http://www.w3.org/1998/Math/MathML">�n 个幸运数。

输入样例 复制

7

输出样例 复制

666

数据范围与提示

数据范围

  • lns="http://www.w3.org/1998/Math/MathML">30%30% 的数据,lns="http://www.w3.org/1998/Math/MathML">1≤�≤5001n500
  • lns="http://www.w3.org/1998/Math/MathML">60%60% 的数据,lns="http://www.w3.org/1998/Math/MathML">1≤�≤1,000,0001n1,000,000
  • lns="http://www.w3.org/1998/Math/MathML">100%100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1≤�≤1,000,000,000,000,0001n1,000,000,000,000,000