加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows Of CCPC

发布时间:2020-12-14 05:49:42 所属栏目:Windows 来源:网络整理
导读:Problem Description In recent years,CCPC has developed rapidly and gained a large number of competitors .One contestant designed a design called CCPC Windows .The 1-st order CCPC window is shown in the figure: And the 2-nd order CCPC windo
Problem Description
In recent years,CCPC has developed rapidly and gained a large number of competitors .One contestant designed a design called CCPC Windows .The 1-st order CCPC window is shown in the figure:



And the 2-nd order CCPC window is shown in the figure:



We can easily find that the window of CCPC of order? k?is generated by taking the window of CCPC of order?k?1?as?C?of order k,and the result of inverting?C/P?in the window of CCPC of order?k?1?as?P?of order?k.
And now I have an order?k?,please output k-order CCPC Windows,The CCPC window of order k is a?2k?2k?matrix.
?

?

Input
The input file contains? T?test samples.(1<=T<=10)

The first line of input file is an integer?T.

Then the?T?lines contains a positive integers k,(1k10)?
?

?

Output
For each test case,you should output the answer .
?

?

?

?
?
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
typedef long long ll;
using namespace std;
const int INT=1e6+5;
#define lson rt<<1,l,m  
#define rson rt<<1|1,m+1,r
#define read(x) scanf("%d",&x)
#define lread(x) scanf("%lld",&x);
#define pt(x) printf("%dn",(x))
#define cn cin>>
#define ct cout<<
#define en <<endl
#define rep(j,k) for (int i = (int)(j); i <= (int)(k); i++)
#define mem(s,t) memset(s,t,sizeof(s))
#define re return 0;
#define TLE std::ios::sync_with_stdio(false);
ll a[100000+5],b[10000+5];
priority_queue<ll>q1,q2;
int main()
{
    TLE;
    char arr[1030][1030];
    arr[0][0]=C;
    arr[0][1]=C;
    arr[1][0]=P;
    arr[1][1]=C;
    ll x;
    for(int i=1;i<=9;i++)
    {
        x=(1<<i);
        //ct x en;
        for(int j=0;j<x;j++)
        {
            for(int k=0;k<x;k++)
            {
                arr[j][k+x]=arr[j][k];
            }
        }

        for(int j=x;j<x*2;j++)
        {
            for(int k=x;k<x*2;k++)
            {
                arr[j][k]=arr[j-x][k];
            }
        }

        for(int j=0;j<x;j++)
        {
            for(int k=0;k<x;k++)
            {
                arr[j+x][k]=arr[j][k]==P?C:P;
            }
        }
    }
    int t,k;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&k);
        x=(1<<k);
        for(int i=0;i<x;i++)
        {
            for(int j=0;j<x;j++)
            {
                printf("%c",arr[i][j]);
            }
            printf("n");
        }
    }


}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读