CF271A Beautiful Year

    • 432通过
    • 653提交
  • 题目来源 CodeForces 271A
  • 评测方式 RemoteJudge
  • 标签 字符串 枚举,暴力 模拟
  • 难度 入门难度
  • 时空限制 2000ms / 256MB

题解

  • 提示:收藏到任务计划后,可在首页查看。
  • 最新讨论 显示

    推荐的相关题目 显示

    题意翻译

    给定一个年份n,输出大于n的第一个四位数字都不相同的年份。

    感谢@引领天下 提供的翻译

    题目描述

    It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits.

    Now you are suggested to solve the following problem: given a year number, find the minimum year number which is strictly larger than the given one and has only distinct digits.

    输入输出格式

    输入格式:

    The single line contains integer $ y $ $ (1000<=y<=9000) $ — the year number.

    输出格式:

    Print a single integer — the minimum year number that is strictly larger than $ y $ and all it's digits are distinct. It is guaranteed that the answer exists.

    输入输出样例

    输入样例#1: 复制
    1987
    
    输出样例#1: 复制
    2013
    
    输入样例#2: 复制
    2013
    
    输出样例#2: 复制
    2014
    
    提示
    标程仅供做题后或实在无思路时参考。
    请自觉、自律地使用该功能并请对自己的学习负责。
    如果发现恶意抄袭标程,将按照I类违反进行处理。