【链接】 我是链接,点我呀:)

【题意】

在这里输入题意

【题解】

直接暴力求出第k个perfect数字就好。
纯模拟。

【代码】

  1. #include <bits/stdc++.h>
  2. #define double long double
  3. using namespace std;
  4. int n;
  5. int _judge(int x){
  6. int num = 0;
  7. while (x){
  8. num+=x%10;
  9. x/=10;
  10. }
  11. return num==10;
  12. }
  13. int main(){
  14. #ifdef LOCAL_DEFINE
  15. freopen("rush_in.txt", "r", stdin);
  16. #endif
  17. ios::sync_with_stdio(0),cin.tie(0);
  18. cin >> n;
  19. int k = 0;
  20. for (int i = 1;i <= (int)2e7;i++)
  21. if (_judge(i)){
  22. k++;
  23. if (k==n){
  24. cout<<i<<endl;
  25. break;
  26. }
  27. }
  28. return 0;
  29. }

【Codeforces Round #460 (Div. 2) B】 Perfect Number的更多相关文章

  1. 【Codeforces Round #460 (Div. 2) D】Substring

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 如果有环 ->直接输出-1 (拓扑排序如果存在某个点没有入过队列,说明有环->即入队的节点个数不等于n 否则. 说明可以 ...

  2. 【Codeforces Round #460 (Div. 2) C】 Seat Arrangements

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 用pre[i][j]表示第i行前j列的和. 然后枚举连续座位的最左上点. (有两种可能向右或向下k个. 则还需要处理出pre2[i] ...

  3. 【Codeforces Round #460 (Div. 2) A】 Supermarket

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 就是让你求m*(ai/bb)的最小值 [代码] #include <bits/stdc++.h> #define dou ...

  4. 【Codeforces Round #427 (Div. 2) B】The number on the board

    [Link]:http://codeforces.com/contest/835 [Description] 原本有一个数字x,它的各个数码的和原本是>=k的; 现在这个数字x,在不改变位数的情 ...

  5. 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers

    [链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...

  6. 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes

    [题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...

  7. 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees

    [题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...

  8. 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory

    [题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...

  9. 【Codeforces Round #423 (Div. 2) C】String Reconstruction

    [Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...

随机推荐

  1. android:为TextView加入样式——下划线,颜色,设置链接样式及前背景色

    实现下划线及颜色设置: public class AtActivity extends Activity { LinearLayout ll;     /** Called when the acti ...

  2. Crytek的幕后花絮

    无论是哪种公司规模和状态.Xsolla都能够为其提供定制化的服务.我们提供定制化的技术集成,而不是提供一系列的解决方式.由于我们致力于满足每个合作伙伴的需求.整套的解决方式还存在着一系列的潜在隐患,我 ...

  3. 【LeetCode-面试算法经典-Java实现】【064-Minimum Path Sum(最小路径和)】

    [064-Minimum Path Sum(最小路径和)] [LeetCode-面试算法经典-Java实现][全部题目文件夹索引] 原题 Given a m x n grid filled with ...

  4. Redis允许远程连接

    默认安装启动redis后,只能本地连接,无法远程连接上,原因是redis安全策略默认本机访问,所以远程访问的话需要将 配置文件redis.cof 中的 bind 127.0.0.1 前面的#注释掉, ...

  5. 3.bind与仿函数以及普通函数

    #include <iostream> #include <string> #include <vector> #include <algorithm> ...

  6. The evolution of cluster scheduler architectures--转

    原文地址:http://www.firmament.io/blog/scheduler-architectures.html cluster schedulers are an important c ...

  7. AD域导入导出命令

    AD域 批量组织机构.用户导入导出 参考网站 https://technet.microsoft.com/zh-cn/library/cc753447(v=ws.11).aspx 导入所有命令 均cm ...

  8. linux傻瓜式安装lnmp

    一.百度 https://lnmp.org/install.html 二.点击 <安装> 三.登录 linux cd /usr/local/ wget -c http://soft.vps ...

  9. php实现自动加载类

    PHP 实现自动加载类:

  10. man帮助

    man命令是Linux下的帮助指令,通过man指令可以查看Linux中的指令帮助.配置文件帮助和编程帮助等信息.