题目链接[https://www.oj.swust.edu.cn/problem/show/1613]

题意:输出第K小的由1、4、7数字组成的数字。

解题过程:1、4、7、11、14、17、41、44、47。。。。。。。找规律。

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = ;
const int mod = 1e9+;
int a[]={,,,};
int ans[maxn];
int k;
int main ()
{
while(~scanf("%d",&k))
{
int len=;
while(k)
{
int t=k%;
if(t==) t=;
ans[++len]=a[t];
k=(k-t)/;
}
for(int i=len;i>=;i--)
printf("%d",ans[i]);
printf("\n");
}
return ;
}

POJ1613 147/思维题的更多相关文章

  1. zoj 3778 Talented Chef(思维题)

    题目 题意:一个人可以在一分钟同时进行m道菜的一个步骤,共有n道菜,每道菜各有xi个步骤,求做完的最短时间. 思路:一道很水的思维题, 根本不需要去 考虑模拟过程 以及先做那道菜(比赛的时候就是这么考 ...

  2. cf A. Inna and Pink Pony(思维题)

    题目:http://codeforces.com/contest/374/problem/A 题意:求到达边界的最小步数.. 刚开始以为是 bfs,不过数据10^6太大了,肯定不是... 一个思维题, ...

  3. ZOJ 3829 贪心 思维题

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3829 现场做这道题的时候,感觉是思维题.自己智商不够.不敢搞,想着队友智商 ...

  4. 洛谷P4643 [国家集训队]阿狸和桃子的游戏(思维题+贪心)

    思维题,好题 把每条边的边权平分到这条边的两个顶点上,之后就是个sb贪心了 正确性证明: 如果一条边的两个顶点被一个人选了,一整条边的贡献就凑齐了 如果分别被两个人选了,一作差就抵消了,相当于谁都没有 ...

  5. C. Nice Garland Codeforces Round #535 (Div. 3) 思维题

    C. Nice Garland time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  6. PJ考试可能会用到的数学思维题选讲-自学教程-自学笔记

    PJ考试可能会用到的数学思维题选讲 by Pleiades_Antares 是学弟学妹的讲义--然后一部分题目是我弄的一部分来源于洛谷用户@ 普及组的一些数学思维题,所以可能有点菜咯别怪我 OI中的数 ...

  7. UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题)

    UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There W ...

  8. HDU 1029 Ignatius and the Princess IV / HYSBZ(BZOJ) 2456 mode(思维题,~~排序?~~)

    HDU 1029 Ignatius and the Princess IV (思维题,排序?) Description "OK, you are not too bad, em... But ...

  9. cf796c 树形,思维题

    一开始以为是个树形dp,特地去学了..结果是个思维题 /* 树结构,设最大点权值为Max,则答案必在在区间[Max,Max+2] 证明ans <= Max+2 任取一个点作为根节点,那么去掉这个 ...

随机推荐

  1. c++中宽字节表示

    1.C++语言中_T Visual C++里边定义字符串的时候,用_T来保证兼容性,VC支持ascii和unicode两种字符类型,用_T可以保证从ascii编码类型转换到unicode编码类型的时候 ...

  2. 连接到sql server 2008 TCP、IP出错

    1.点击 开始 --> 所有程序 --> Microsoft SQL Server2008 --> 配置工具-->SQL Server  configuration Manag ...

  3. centos php 扩展安装

    1. 安装mysqli扩展 1.进入php源代码目录:# cd /home/apps/web/php/php-5.3.5/ 2.再进入要添加的mysqli扩展源码目录:# cd ext/mysqli/ ...

  4. html 页面太长滚动时,固定页面菜单标签,或者导航标签的位置,fixed/stickUp the position

    有时你曾经需要把页面上的某些东西当页面太长发滚动的时候保留置顶位置显示,或许你有别的实现方式,我这个仅供参考, 源代码: /*global $, jQuery, alert*/ (function ( ...

  5. python 学习 [day6]

    递归阶乘: 函数自己调用自己循环操作的模式称之为递归 def func(num): if num == 1: return 1 return num * func(num - 1) print(fun ...

  6. MyBatis中update的使用

    当你传入所需要修改的值为一个实体对象时,可能只改动了其中部分的值.那么其他值需要做一个判断是否为空值的操作. XXXmapper.xml <update id="updateMembe ...

  7. OpenCV程序在Debug时出现「PDB文件无法加载」的一个解决方法

    这几天毕设要用到OpenCV,按照网上的教程来搭建开发环境. 用的是OpenCV 3.0 beta + Visual Studio Community 2013.我的系统64位是Win 8.1,但在加 ...

  8. pythonRedis 订阅功能实现

    两天机器做,host要写订阅主机的ip,客户端发消息,服务端订阅消息 cat redis_connector.py #!/usr/bin/env python__author__ = 'Q.Li'im ...

  9. Space Shooter

    项目:https://pan.baidu.com/s/1jIDe2H4 using UnityEngine; using System.Collections; namespace VoidGame ...

  10. de4dot 脱壳工具

    开源免费的一款工具 官方地址http://www.de4dot.com/ 很NB的工具,能脱大部分的壳 如下 Babel.NET CodeFort CodeVeil CodeWall CryptoOb ...