0
点赞
收藏
分享

微信扫一扫

蓝桥杯2021年第十二届C++省赛第二题-卡片

M4Y 2022-04-01 阅读 69
leetcode

在这里插入图片描述

Idea

AC Code

#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<unordered_set> 
#include<unordered_map> 
using namespace std;
typedef long long ll;
#define MAX_SIZE 100005
#define MOD 1000000009


int main(){
	int a[10];
	for(int i = 0 ; i <= 9 ;i++) a[i] = 2021;
	for(int i = 1 ; i <= MAX_SIZE ;i++){
		int n = i;
		while(n){
			if(a[n % 10] == 0){
				cout<< i - 1;
				return 0;
			}
			a[n % 10]--;
			n /= 10;
		}
	}
	return 0;
}

Answer

3181
举报

相关推荐

0 条评论