构造

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; int a[][][];
int main()
{
a[][][]=;
a[][][]=;
a[][][]=;
a[][][]=-; int len=;
for(int i=; i<=; i++)
{
len=len*;
for(int r=; r<=len/; r++)
for(int c=; c<=len/; c++)
a[i][r][c]=a[i-][r][c]; for(int r=; r<=len/; r++)
for(int c=len/+; c<=len; c++)
a[i][r][c]=a[i-][r][c-len/]; for(int r=len/+; r<=len; r++)
for(int c=; c<=len/; c++)
a[i][r][c]=a[i-][r-len/][c]; for(int r=len/+; r<=len; r++)
for(int c=len/+; c<=len; c++)
a[i][r][c]=-a[i-][r-len/][c-len/];
} int n;
while(~scanf("%d",&n))
{
int len=pow(,n);
for(int i=; i<=len; i++)
{
for(int j=; j<=len; j++)
{
if(a[n][i][j]==) printf("+");
else printf("*");
}
printf("\n");
}
}
return ;
}

CodeForces 610C Harmony Analysis的更多相关文章

  1. Codeforces Round #337 (Div. 2) 610C Harmony Analysis(脑洞)

    C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard ...

  2. 【53.57%】【codeforces 610C】Harmony Analysis

    time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  3. Codeforces Round #337 (Div. 2) C. Harmony Analysis 构造

    C. Harmony Analysis 题目连接: http://www.codeforces.com/contest/610/problem/C Description The semester i ...

  4. Codeforces Round #337 (Div. 2) C. Harmony Analysis 数学

    C. Harmony Analysis   The semester is already ending, so Danil made an effort and decided to visit a ...

  5. Codeforces 610C:Harmony Analysis(构造)

    [题目链接] http://codeforces.com/problemset/problem/610/C [题目大意] 构造出2^n个由1和-1组成的串使得其两两点积为0 [题解] 我们可以构造这样 ...

  6. Codeforces Round #337 (Div. 2) C. Harmony Analysis

    题目链接:http://codeforces.com/contest/610/problem/C 解题思路: 将后一个矩阵拆分为四个前一状态矩阵,其中三个与前一状态相同,剩下一个直接取反就行.还有很多 ...

  7. Codeforces Round #337 (Div. 2)

    水 A - Pasha and Stick #include <bits/stdc++.h> using namespace std; typedef long long ll; cons ...

  8. Codeforces Round #596 (Div. 2, based on Technocup 2020 Elimination Round 2)

    A - Forgetting Things 题意:给 \(a,b\) 两个数字的开头数字(1~9),求使得等式 \(a=b-1\) 成立的一组 \(a,b\) ,无解输出-1. 题解:很显然只有 \( ...

  9. cf 337 div2 c

    C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard ...

随机推荐

  1. 缩放系列(二):所有子控件也随着缩放、手势缩放、多点触控layout

    下面是一个功能强大的改造的例子: 可以实现以下需求: 1.两个手指进行缩放布局 2.所有子控件也随着缩放, 3.子控件该有的功能不能丢失(像button有可被点击的功能,缩放后不能丢失该功能) 运行效 ...

  2. 以excel方式输出数据

    主类Test: public class D201 {//get set 方法略去 private String d201_01; private String d201_02; private St ...

  3. mongostat

    监控MongoDB有一下几种方法: 1)使用MongoDB软件包自带的工具,如mongostat,mongotop等.2)使用MongoDB数据库命令3)使用MongoDB公司提供的MMS监控服务 m ...

  4. 使WiFi具有保存历史连接的功能

    在wpa_supplicant.conf里面添加这个功能 update_config=1 就能更新了,保存了历史的连接AP,不用再输入密码

  5. .net网站报错:对象的当前状态使该操作无效

    微软在2011年12月29号发布的2011年最后一个更新让哥哥为程序出现的异常头痛了一天. 这个异常在页面数据量小的时候并不会触发,只在页面数据量大的情况下才会出现,开始解决起来让人无从下手,最后才发 ...

  6. Got Stucked in C++ Static Library Loading.. for some time

    I used to load library using 1 single .dll file, so when I happen to do method calling between 2 pro ...

  7. 最短路<dijk>

    题意: 有n个城市,有m条路,给出每条路的出发和结束的城市及长度,求从第一个城市到最后一个城市的最短路.按格式输出. power oj 2443 题解: 标准dijk算法. #include<c ...

  8. jz2440 环境搭建遇到的问题

    已解决:

  9. Node.js学习 - File Operation

    同步异步 文件系统(fs 模块)模块中的方法均有异步和同步版本,例如读取文件内容的函数有异步的 fs.readFile() 和同步的 fs.readFileSync(). 异步的方法函数最后一个参数为 ...

  10. Oracle新建用户赋只读某几张表的权限

    create user JSETI_WZQ identified by abcdef; -- 假设abcdef是密码 grant connect,resource to JSETI_WZQ; gran ...