Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <cstdio>
- #include <algorithm>
- #include <stack>
- #include <string>
- #include <vector>
- #include <map>
- #include <queue>
- #define ll long long
- #define f first
- #define s second
- #define pb push_back
- #define mp make_pair
- using namespace std;
- int n, cnt[100010], b[100010], i;
- double answ[100010];
- vector <int> a[100010];
- int cnt1, cnt2;
- void dfs(int lvl, int v)
- {
- if (lvl == i)
- {
- if (v == 1)
- {
- cnt1++;
- cnt2++;
- }
- else cnt2++;
- }
- else
- {
- if (v == 1)
- {
- dfs(lvl + 1, 0);
- dfs(lvl + 1, 0);
- }
- else
- {
- dfs(lvl + 1, 1);
- dfs(lvl + 1, 0);
- }
- }
- }
- void f()
- {
- for (int j = 2; j <= cnt1; j++)
- {
- if (cnt1 % 2 == 0 && cnt2 % 2 == 0)
- {
- cnt1 /= 2;
- cnt2 /= 2;
- }
- }
- }
- int main()
- {
- for (i = 1; i <= 50; i++)
- {
- cnt1 = 0;
- cnt2 = 0;
- dfs(1, 1);
- f();
- cout << cnt1 << " " << cnt2 << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment