5-10 WAWAWA
查看原帖
5-10 WAWAWA
528867
Paris_Commune楼主2022/1/16 13:24
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <cctype>
int s[5][100005],a;
long long nm;
int asdfds;
int main()
{
	scanf("%d",&a );
	nm=1<<a;
	for(int z=1;z<=nm;z+=1)
	{
		for(int y=nm-z;y>=1;y-=1)
  		{
  			std::cout<<0<<' ';
  		}
		int i1=z%2;
		s[i1][z]=1;
		for(int x=1;x<z;x+=1)
		{
			s[i1][x]=s[!i1][x]+s[!i1][x-1];
		}
		for(int w=1;w<=z;w+=1)
		{
			if(s[i1][w]%2==1)
			{
				std::cout<<1<<' ';
			}
			else
			
			{
				std::cout<<0<<' ';
			}
		}
		std::cout<<"\n";
	}
	return 0;
}
2022/1/16 13:24
加载中...