蓝桥杯12021

卡片

 

 1 #include <iostream>
 2 #include <cmath>
 3 #include <algorithm>
 4 #include <iomanip>
 5 using namespace std;
 6 int cnt[10]={0};
 7 int main(){
 8     for(int i=0;i<=9;i++) cnt[i]=2021;
 9     for(int i=1;;i++){
10         int t=i;
11         while(t){
12             if(cnt[t%10]==0) {
13                 cout<<i-1;
14                 return 0;
15             };
16             cnt[t%10]--;
17             t/=10;
18         }
19     }
20     return 0;
21 }

就是枚举

posted @ 2022-12-31 17:50  阿飞藏泪  阅读(27)  评论(0编辑  收藏  举报
1 2 3
4