CodeForces 610C Harmony Analysis
构造
#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的更多相关文章
- 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 ...
- 【53.57%】【codeforces 610C】Harmony Analysis
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- Codeforces Round #337 (Div. 2) C. Harmony Analysis 构造
C. Harmony Analysis 题目连接: http://www.codeforces.com/contest/610/problem/C Description The semester i ...
- 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 ...
- Codeforces 610C:Harmony Analysis(构造)
[题目链接] http://codeforces.com/problemset/problem/610/C [题目大意] 构造出2^n个由1和-1组成的串使得其两两点积为0 [题解] 我们可以构造这样 ...
- Codeforces Round #337 (Div. 2) C. Harmony Analysis
题目链接:http://codeforces.com/contest/610/problem/C 解题思路: 将后一个矩阵拆分为四个前一状态矩阵,其中三个与前一状态相同,剩下一个直接取反就行.还有很多 ...
- Codeforces Round #337 (Div. 2)
水 A - Pasha and Stick #include <bits/stdc++.h> using namespace std; typedef long long ll; cons ...
- 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. 题解:很显然只有 \( ...
- cf 337 div2 c
C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard ...
随机推荐
- qq客服问题
angularJs会给ng-href的不正常跳转,会 添加unsafe的前缀.原因是angular对href是有安全检查的,只能生成它认为安全的链接.解决方法如下: 在config.js中注入 fun ...
- Windows下MySQL分步安装图解及问题总结
MySQL是一个出色的开源数据库,在易用性和性能方面都有相当不错的表现.就作者发帖为止, MySQL官方发布的所有版本中(4.1/5.0/5.1/6.0),推荐使用稳定的MySQL5.0版本(商用). ...
- 快学Scala-第二章 控制结构和函数
知识点: 1.条件表达式 if(x>0) 1 else 0 scala每个表达式都有一个类型,如果一致则为它们的类型,如果为混合类型表达式,则为它们的公共超类型Any. if(x>0) 1 ...
- [转]SSL协议与数字证书原理
1 SSL(Secure Socket Lclientyer)是netscclientpe公司设计的主要用于weserver的安全传输协议.这种协议在WESERVER上获得了广泛的应用. SSL在TC ...
- c# 获取客户端ip
针对 HttpContext.Current.Request.UserHostAddress 如果客户使用的是代理,将获取不到真是的ip 要想透过代理服务器取得客户端的真实IP地址,就要使用 Requ ...
- Linux学习 -- 文件系统管理
1 分区和文件系统 分区类型 主分区:<= 4个 扩展分区:只能有一个,也算主分区的一种 不能存储数据和格式化,只能用来包含逻辑分区 逻辑分区:扩展分区中划分的 IDE--最多59个 ...
- Light OJ - 1058 Parallelogram Counting(判定平行四边形)
Description There are n distinct points in the plane, given by their integer coordinates. Find the n ...
- 转:Web安全与Rational AppScan入门
Web 应用的基础概念 在讨论 Web 应用安全之前,先简单介绍一下 Web 应用基础概念,这样便于理解为什么 Web 应用是脆弱的,容易受到攻击. 1. 什么是 Web 应用 Web 应用是由动态脚 ...
- 在Visual C++中的用ADO进行数据库编程
1. 生成应用程序框架并初始化OLE/COM库环境 创建一个标准的MFC AppWizard(exe)应用程序,然后在使用ADO数据库的InitInstance函数中初始化OLE/COM库(因为ADO ...
- PAT1001
时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B Calculate a + b and output the sum in standard format 计算a+b ...