Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- vector<int>nums;
- int kek;
- int cheak1;
- int cheak2;
- int g =0;
- int fak(int a, int b){
- for (int i = 0; i < b; ++i){
- a = 2 * a;
- }
- return a;
- }
- int fuck(int a, int y = kek, int pro = 0){
- if (cheak1 == cheak2){
- cheak2 = 0;
- return 9;
- }
- if(a<=y/2){
- nums.push_back(0);
- cheak2+=1;
- fuck(a,y/2);
- return 9;
- }
- else{
- nums.push_back(1);
- cheak2+=1;
- fuck(a/2,y/2);
- return 9;
- }
- }
- int main() {
- int a,b,l;
- cin>>a;
- l = 0;
- cheak1=a;
- kek = fak(1,a);
- for(int i = 0; i < kek/2; ++i){
- fuck(i+1);
- g = 0;
- }
- for(int i = 0; i < kek/2; i++){
- l+=a;
- nums.push_back(1);
- for(int j = 0; j < a -1;++j){
- nums.push_back(nums[l-a+1+j]);
- }
- }
- l = 0;
- for(int i = 0; i < nums.size()/3; i++){
- l+=a;
- for(int j = 0; j < a;++j){
- cout<<nums[l-a+j]<<" ";
- }
- cout<<"\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement