构造

#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. 5.1 timestamp数据类型默认值

    5.1 不支持同一张表中有多个tmiestamp类型字段的默认值为current_time,  5.6版本无此问题

  2. document.querySelectorAll遍历(forEach小解)

    document.querySelectorAll兼容性良好,在之前的项目中就其遍历方式出了错误,先做个小结: 1.for循环 传统遍历方法 for(var i= 0; i< document. ...

  3. idea 注册机生成密钥代码

    import java.math.BigInteger; import java.util.Date; import java.util.Random; import java.util.zip.CR ...

  4. Android OpenGL ES(四)关于EGL .

    OpenGL ES的javax.microedition.khronos.opengles 包定义了平台无关的GL绘图指令,EGL(javax.microedition.khronos.egl ) 则 ...

  5. LightOJ 1030 Discovering Gold 数学期望计算

    题目大意:给出长度为n的一条隧道,每个位置都有一定数量的财宝.给你一枚骰子,roll到几点就前进几步,如果即将到达的地方超过了这条隧道长度,就重新roll一次,走到n点结束.求这个过程能收获多少财宝. ...

  6. Swift 学习笔记 (一)

    原创: 转载请注明出处 Extention try catch rxSwift internal  public  private var  let as       as? 强转 ? ! didSe ...

  7. json-c代码示例

    #include <stdio.h> #include <string.h> #include <json.h> int main(int argc,char ** ...

  8. Objective-C相关Category的收集

    Objective-C相关Category的收集 Categories是给你得不到源码的classes增加功能的一种方法.这个页面收集一些相关的Category,并且持续更新,你可以订阅关注.作者是F ...

  9. 随机法解决TSP问题

    TSP问题一直是个头疼的问题,但是解决的方法数不胜数,很多的算法也都能解决.百度资料一大堆,但是我找到了代码比较简练的一种.随机法.下面只是个人的看法而已,如果有任何问题虚心接受. 顾名思义,随机法就 ...

  10. hdu_2546_饭卡(01背包)

    题目连接:hdu_2546_饭卡 题意:中文,不解释 题解:先拿5元来买最贵的,最后就是一个01背包,这里也算用到贪心的思想 #include<bits/stdc++.h> #define ...