classy专题

Educational Codeforces Round 50 (Rated for Div. 2) C. Classy Numbers(dfs+二分)

题目链接:http://codeforces.com/contest/1036/problem/C 题意:给你一个区间,求非零数字不超过3个的十进制数的个数。 思路:构造所有的符合条件的数放入vector,然后二分查找上下界。 #include <bits/stdc++.h>using namespace std;#define ll long long#define IOS ios:

Educational Codeforces Round 50 (Rated for Div. 2) C. Classy Numbers(dfs构造某类数)

题目链接 题意:找出区间[L, R]之间最多有三位是非零数字的十进制数的个数; 思路:用构造出所有的满足题意的数,然后排序,二分找; #include <bits/stdc++.h>using namespace std;typedef long long ll;vector<ll> vec;void dfs(ll cur, int cnt, int len){vec.push_ba