fork download
  1. // Src : Vux2Code
  2. /* Note :
  3.  
  4. */
  5.  
  6. #include <bits/stdc++.h>
  7. #define fi first
  8. #define se second
  9.  
  10. using namespace std;
  11.  
  12. // template <typename T> void vout(T s){ cout << s << endl; exit(0);}
  13.  
  14. typedef long long ll;
  15. typedef long double ld;
  16. typedef pair <ll, ll> pll;
  17.  
  18. const ll maxN = 2e5 + 5, maxLog = 20, inf64 = 1e18, inf32 = 1e9, mod = 1e9 + 7;
  19.  
  20. void maximize (ll &x, ll y) {x = max (x, y);}
  21. void minimize (ll &x, ll y) {x = min (x, y);}
  22.  
  23. /* ---------HASHING-------- */
  24. // const base = 31, mod2 = 1e9 + 9;
  25.  
  26. /* ---------BITMASK-------- */
  27. // ll count (ll x) {return __builtin_popcountll (x);}
  28. // ll fst (ll x) {return 63 - __builtin_clzll (x);}
  29. // ll last (ll x) {return __builtin_ctzll (x);}
  30. // bool bit (ll x, ll y) {return ((x >> y) & 1);}
  31.  
  32. ll t = 1;
  33.  
  34. ll a, b, ans;
  35.  
  36. void fk (ll pos, ll digit) {
  37. if (digit > 15) return;
  38. pos = pos * 10 + 7;
  39. if (pos >= a && pos <= b) ans ++;
  40. fk (pos, digit + 1);
  41. pos /= 10;
  42. pos = pos * 10 + 9;
  43. if (pos >= a && pos <= b) ans ++;
  44. fk (pos, digit + 1);
  45. pos /= 10;
  46. }
  47.  
  48. void solve () {
  49. cin >> a >> b;
  50. fk (0, 0);
  51. cout << ans;
  52. }
  53.  
  54. int main () {
  55. ios::sync_with_stdio (0);
  56. cin. tie (0);
  57. cout. tie (0);
  58. #define TASK "hoahong"
  59. if (fopen (TASK".inp", "r")) {
  60. freopen (TASK".inp", "r", stdin);
  61. freopen (TASK".out", "w", stdout);
  62. }
  63. // cin >> t;
  64. while (t --) solve ();
  65. }
  66.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty