CodeForces 271 A.Beautiful Year(水~)
来源:互联网 发布:fc存储网络 编辑:程序博客网 时间:2024/06/03 22:30
Description
给出一整数
Input
一个正整数
Output
输出大于
Sample Input
1987
Sample Output
2013
Solution
水题,从
Code
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>#include<cmath>#include<vector>#include<queue>#include<map>#include<set>#include<ctime>using namespace std;typedef long long ll;typedef pair<int,int>P;const int INF=0x3f3f3f3f,maxn=100001;int check(int n){ int a[5],res=0; while(n) { a[res++]=n%10,n/=10; } for(int i=0;i<res;i++) for(int j=i+1;j<res;j++) if(a[i]==a[j])return 0; return 1;}int main(){ int n; while(~scanf("%d",&n)) { for(int i=n+1;;i++) if(check(i)) { printf("%d\n",i); break; } } return 0;}
阅读全文
0 0
- CodeForces 271 A.Beautiful Year(水~)
- codeforces 271A(Beautiful Year) Java
- CodeForces-271A-Beautiful Year
- CodeForces 271A - Beautiful Year
- codeforces 271A Beautiful Year
- codeforces 271A Beautiful Year(暴力水题)
- 271A Beautiful Year
- A. Beautiful Year
- A. Beautiful Year
- CodeForces 263 A.Beautiful Matrix(水~)
- CF 271 Beautiful Year
- CodeForces 500 A. New Year Transportation(水~)
- CodeForces 611 A. New Year and Days(水~)
- 【CodeForces】611A - New Year and Days(水)
- 【Codeforces】-611A-New Year and Days(水)
- CodeForces 379 A.New Year Candles(水~)
- CodeForces 808A Lucky Year(思维)
- codeforces 263A(Beautiful Matrix) Java
- PATbasic1003
- html5 学习笔记
- 软件测试题(1)
- Codeforces848D Shake It! -- DP
- C++ 位运算技巧
- CodeForces 271 A.Beautiful Year(水~)
- Leetcode 405. Convert a Number to Hexadecimal
- git常用命令行
- 函数圈复杂度介绍
- [ahk]使total commander在单双窗口间切换
- 1、常用命令练习
- 【广告项目】URL后面拼接参数中文乱码
- Shell
- CompletableFuture用法