题目链接

https://www.patest.cn/contests/gplt/L1-033

AC代码

#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream> using namespace std;
typedef long long LL; const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6; const int MAXN = 0x3f3f3f3f;
const int MINN = 0xc0c0c0c0;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7; int f(int y)
{
map <int, int> m;
m.clear();
if (y < 1000)
m[0] = 1;
while (y)
{
m[y % 10] = 1;
y /= 10;
}
return m.size();
} int main()
{
int y, n;
cin >> y >> n;
int ans = 0;
while (1)
{
if (f(y) == n)
break;
y++;
ans++;
}
printf("%d %04d\n", ans, y);
}

PAT 天梯赛 L1-033. 出生年 【水】的更多相关文章

  1. PAT 天梯赛 L1-047. 装睡 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-047 AC代码 #include <iostream> #include <cstdio&g ...

  2. PAT 天梯赛 L1-042. 日期格式化 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-042 AC代码 #include <iostream> #include <cstdio&g ...

  3. PAT 天梯赛 L1-041. 寻找250 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-041 AC代码 #include <iostream> #include <cstdio&g ...

  4. PAT 天梯赛 L1-022. 奇偶分家 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-022 AC代码 #include <iostream> #include <cstdio&g ...

  5. PAT 天梯赛 L1-016. 查验身份证 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-016 AC代码 #include <iostream> #include <cstdio&g ...

  6. PAT 天梯赛 L1-014. 简单题 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-014 AC代码 #include <iostream> #include <cstdio&g ...

  7. PAT 天梯赛 L1-012. 计算指数 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-012 AC代码 #include <iostream> #include <cstdio&g ...

  8. PAT 天梯赛 L1-010. 比较大小 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-010 AC代码 #include <iostream> #include <cstdio&g ...

  9. PAT 天梯赛 L1-007. 念数字 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-007 AC代码 #include <iostream> #include <cstdio&g ...

  10. PAT 天梯赛 L1-004. 计算摄氏温度 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-004 AC代码 #include <iostream> #include <cstdio&g ...

随机推荐

  1. DataUml Design 教程6-DataUML Design 1.1版本正式发布(支持PD数据模型)

    从DataUML Design正式发布到现在有两个月了,由于最近比较忙,到现在才发布1.1版本.以后本人会一直坚持不断完善DataUML Design软件,希望广大程序猿们多多支持. 一.1.1版本新 ...

  2. export,source

    source会把定义在脚本文件中的变量放在当前shell中 export会把变量放在他所在的shell进程以及子进程shell中 子shell进程可以访问父shell进程的export 声明的变量,但 ...

  3. start-stop-daemon

    start-stop-daemon是OpenRC计划的一部分,这个程序最先出现在Debian系的Linux发行版中,这里有个比较古老的手册页面,更详细更直观的办法当然是通过man start-stop ...

  4. 怎样在asp.net中用一般处理文件ashx实现下载功能

    /// <summary> /// 下载文件,支持大文件.续传.速度限制.支持续传的响应头Accept-Ranges.ETag,请求头Range . /// Accept-Ranges:响 ...

  5. Gallery学习————检测手机中是否存在外部存储设备

    在缓存数据的时,有时候会出现没有外部存储设备的情况,所以需要检测是否存在外部存储设备 /** * 检测外部存储设备 * * @param requireWriteAccess * @return */ ...

  6. PYTHON MYSQL 的表创建和插入

    import mysql.connector cnx = mysql.connector.connect(user='xx',password='xx++.',host='139.107.11.166 ...

  7. shell脚本中echo显示内容带颜色显示

    格式如下 : echo -e "\033[41;36m something here \033[0m" 其中41的位置代表底色, 36的位置是代表字的颜色 注: 1.字背景颜色和文 ...

  8. jQuery插件-json2.js

    from:http://blog.csdn.net/gjb724332682/article/details/46682743 前言 json2.js是一个json插件,下载地址:https://gi ...

  9. sql server 2008获取表的字段注释

    SELECT 表名 then d.name else '' end, 表说明 then isnull(f.value,'') else '' end, 字段序号=a.colorder, 字段名=a.n ...

  10. Centos7配置外部网络访问

    Centos7配置外部网络访问 一.安装步骤中的重要配置: 默认是动态ip配置,有需要可以改成静配置 BOOTPROTO="static" 二.如果不能联网,按照如下步骤设置网络: ...