Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define times(I, X) for (int I=0; I<X; I++)
- #define rtimes(I, X) for(int I=X; I>=0; I--)
- #ifdef DEBUG
- #define dump(X) std::cout << __LINE__ << "L: [" << #X << "] = [" << X << "]\n"
- #else
- #define dump(X)
- #endif
- #define pb push_back
- #define int long long
- #define fi first
- #define se second
- using namespace std;
- const int sze = 2e5;
- long long binpow (long long a, long long n)
- {
- long long res = 1;
- while (n)
- {
- if (n & 1)
- res *= a;
- a *= a;
- n >>= 1;
- }
- return res;
- }
- signed main() {
- #ifndef DEBUG
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- // freopen("basis.in", "r", stdin);
- // freopen("basis.out", "w", stdout);
- #endif
- int n = 2021;
- int res = 0;
- vector<int> vec(2021);
- vec[1] = 1;
- for(int i = 2; i < n; i++)
- {
- if(i % 2 == 0)
- {
- vec[i] = vec[i / 2];
- }
- else{
- vec[i] = vec[i / 2] + 1;
- }
- if(vec[i] == 9)
- {
- res++;
- cout << i << " " << vec[i] << endl;
- }
- }
- cout << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement