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,(1≤k≤10)?
?
?
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"); } } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- .net – Windows 8是否支持System.Device.Location?
- 备份 – 如果Windows Home Server系统驱动器出现故障会怎样
- .NET的哪些部分需要执行管理权限?
- Windows平台安装配置mysql数据库
- NSIS:什么是注册表?
- Windows – 如何使用DoEvents()而不是“邪恶”?
- windows-server-2008 – Windows 2008的邮件服务器
- 获取Microsoft 10 Edge浏览器Mime类型php
- windows – Hyper-V:移动过程中出错:不支持操作
- Windows 8 C#和XAML应用程序的程序体系结构,具有图形功能
推荐文章
站长推荐
- windows-8 – 如何在Windows 8.1(IE11和Modern U
- windows-7 – 将用户升级到Win7.现在在保存文件或
- windows-server-2003 – 配置文件和主路径之间的
- 如何在Windows批处理文件中将PATH设置为带空格的
- 如何在用户拒绝一次后再次询问用户使用Geolocati
- windows-phone-7 – Windows phone 7选择ListBox
- Windows – Node.js 0.5.x的递归目录创建
- Windows的虚拟网络接口
- Windows – TextPad和Unicode:完全支持?
- windows-server-2008 – 无法连接到SSTP VPN –
热点阅读