Codeforces Round #337 (Div. 2) C. Harmony Analysis
题目链接:http://codeforces.com/contest/610/problem/C
解题思路:
将后一个矩阵拆分为四个前一状态矩阵,其中三个与前一状态相同,剩下一个直接取反就行。还有很多种取法,这种比较方便就是。
实现代码:
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int a[][],b[][];
int main()
{
int n;
cin>>n;
int k = ,t1=,t0=,i,j;
while(k<=n){
k++; t1=<<(k); t0=<<(k-);
b[][] = ;
for(i=;i<=t0;i++)
for(j=;j<=t0;j++)
b[i][j] = b[t0+i][j]=b[i][j+t0]=a[i][j];
for(i=;i<=t0;i++)
for(j=;j<=t0;j++)
b[i+t0][j+t0]= - a[i][j];
for(i=;i<=t1;i++)
for(j=;j<=t1;j++)
a[i][j] = b[i][j]; }
for(i=;i<=(<<n);i++){
for(j=;j<=(<<n);j++){
if(a[i][j]==)
cout<<"+";
else cout<<"*";
}
cout<<endl;
}
return ;
}
Codeforces Round #337 (Div. 2) C. Harmony Analysis的更多相关文章
- 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 Round #337 (Div. 2) 610C Harmony Analysis(脑洞)
C. Harmony Analysis time limit per test 3 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #337 (Div. 2)
水 A - Pasha and Stick #include <bits/stdc++.h> using namespace std; typedef long long ll; cons ...
- Codeforces Round #337 (Div. 2) D. Vika and Segments 线段树扫描线
D. Vika and Segments 题目连接: http://www.codeforces.com/contest/610/problem/D Description Vika has an i ...
- Codeforces Round #337 (Div. 2) B. Vika and Squares 贪心
B. Vika and Squares 题目连接: http://www.codeforces.com/contest/610/problem/B Description Vika has n jar ...
- Codeforces Round #337 (Div. 2) A. Pasha and Stick 数学
A. Pasha and Stick 题目连接: http://www.codeforces.com/contest/610/problem/A Description Pasha has a woo ...
- Codeforces Round #337 (Div. 2) D. Vika and Segments (线段树+扫描线+离散化)
题目链接:http://codeforces.com/contest/610/problem/D 就是给你宽度为1的n个线段,然你求总共有多少单位的长度. 相当于用线段树求面积并,只不过宽为1,注意y ...
- Codeforces Round #337 (Div. 2) D. Vika and Segments 线段树 矩阵面积并
D. Vika and Segments Vika has an infinite sheet of squared paper. Initially all squares are whit ...
随机推荐
- Spring Boot 之订制 logo
Spring Boot 之订制 logo 简介 变量 配置 编程 源码 引申和引用 Spring Boot 启动时默认会显示以下 logo: . ____ _ __ _ _ /\\ / ___'_ _ ...
- Jquery 图片延迟加载技术
参考网址:http://code.ciaoca.com/jquery/lazyload/ 延迟加载能大大增加你网站的加载速度! 需要引入以下文件<Jq文件也是少不了的>: <scri ...
- 汇编 指令lodsb,lodsw,lodsd
知识点: 汇编指令 lodsb,lodsw,lodsd 一.汇编指令LODSB //scasb scasw scasd //stosb stosw stosd 1. __asm lodsb //作用 ...
- AT3611 Tree MST
题面 题解 考虑最小化\(dis(x, y)\) 这里需要对一种奇怪的最小生成树算法:Boruvka算法有深刻的理解. 考虑该算法的执行过程,我们可以考虑进行点分治,每次找到离分治重心最近的点,然后将 ...
- Mysql8.0的登录大坑……(忘记登录密码也可以这么搞)
关于安装和使用就不说了,属于基本操作了: 我来重点记录一下关于使用前,使用navicat登录的时候报错,1130和2059 查看安装后随机生成的密码: grep 'temporary password ...
- Ceph分布式存储-运维操作笔记
一.Ceph简单介绍1)OSDs: Ceph的OSD守护进程(OSD)存储数据,处理数据复制,恢复,回填,重新调整,并通过检查其它Ceph OSD守护程序作为一个心跳 向Ceph的监视器报告一些检测信 ...
- centos6.8下LNMP (nginx1.8.0+php5.6.10+mysql5.6.12) - 部署手册
在平时运维工作中,经常需要用到LNMP应用框架.以下对LNMP环境部署记录下: 1)前期准备:为了安装顺利,建议先使用yum安装依赖库[root@opd ~]#yum install -y make ...
- Jmeter-使用Ultimate Thread Group插件来设置负载场景
前言: Jmeter插件相关请移步:https://www.jianshu.com/p/130c7fddeddf 自定义线程组:jp@gc - Ultimate Thread Group,功能强大,可 ...
- 2017乌鲁木齐区域赛D题Fence Building-平面图的欧拉公式
这个题B站上面有这题很完整的分析和证明,你实在不懂,可以看看这个视频 https://www.bilibili.com/video/av19849697?share_medium=android&a ...
- sixsix团队M2阶段Postmortem
设想和目标 1. 我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描述? 要解决的问题:目前外卖网站比较多,用户很难快速找到合适的外卖,我们集合各个网站的外卖信息,为用户提 ...