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 ...
随机推荐
- web项目从域名申请到发布
http://wenku.baidu.com/link?url=H-Hu2nvzFRirdxO3xzrWCWfc4WJFLyFjsxak5MFwOuzQfgTawJLXC4vAc4xYAIySxn59 ...
- C#在Json反序列化中处理键的特殊字符
假设有如下Json 数据: 1.{ 2."id" : 1, 3."@value" : "this a @", 4."$p" ...
- centos7配置ip
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 ONBOOT=yes 重启ip服务 systemctl restart network.service 开 ...
- CocoaAsyncSocket框架的简单封装
在iOS开发中使用socket(CFNetwork),一般都是用第三方库AsyncSocket. 参考博客:http://my.oschina.net/worldligang/blog/396881? ...
- swfupload在chrome中点击上传图片按钮无反应的解决办法
chrome 22.0.XXXXX dev版上传图片按钮点击无反应原因:是GOOGLE的内建Flash PPAPI外挂所导致的. 问题原因: 由于Google浏览器(Chrome),在最新测试版22. ...
- 【二分图】 poj 1466
#include <iostream> #include <memory.h> #include <cstdio> using namespace std; int ...
- 最简单易懂的webService客户端之soap+xml请求
代码准备: 1.网络上有提供一些免费的服务器测试地址,可以上这里找一找:https://my.oschina.net/CraneHe/blog/183471 2.我选择了一个翻译地址:http://w ...
- 80-th Level Archeology
80-th Level Archeology time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- HUST - 1599 Multiple
input 长度不大于3*10e5的数字串 output 不含前导0的能整除64的字串的个数(0算一个,064不算) 一般数组中找能整除一个数的字串都是用取余来做的 用一个a[64]来存下从1-i位累 ...
- runtime基础
前言 学习Objective-C的运行时Runtime系统是很有必要的.个人觉得,得之可得天下,失之则失天下. Objective-C提供了编译运行时,只要有可能,它都可以动态地运作.这意味着不仅需要 ...