lanqiao 1443 卡片(朴素解法)
This commit is contained in:
20
12lanqiao/test2-1.cpp
Normal file
20
12lanqiao/test2-1.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// lanqiao 1443 卡片(朴素解法)
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
const int N = 10;
|
||||
int a[N];
|
||||
int main(){
|
||||
for(int i = 0; i <= 9; i++) a[i] = 2021;
|
||||
for(int j = 1; ;j++){
|
||||
int t = j;
|
||||
while(t){
|
||||
a[t%10]--;
|
||||
if(a[t%10] < 0){
|
||||
cout << j - 1 << endl;
|
||||
return 0;
|
||||
}
|
||||
t /= 10;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user