A Mist of Florescence CodeForces - 989C(思维构造)
题意:
让你构造一个图,使得A,B,C,D的个数为给定的个数,上下左右连通的算一个。
哎呀 看看代码就懂了。。emm。。很好懂的
#include <bits/stdc++.h>
using namespace std;
const int maxn = , INF = 0x7fffffff;
char str[][];
int main()
{
for(int i=; i<; i++)
for(int j=; j<; j++)
if(i<)
str[i][j] = 'A';
else
str[i][j] = 'B';
int a, b, c, d;
cin>> a >> b >> c >> d;
a--, b--;
for(int i=; i<; i+=)
for(int j=; j<; j+=)
if(b)
str[i][j] = 'B', b--;
else if(d)
str[i][j] = 'D', d--;
for(int i=; i<; i+=)
for(int j=; j<; j+=)
if(a)
str[i][j] = 'A', a--;
else if(c)
str[i][j] = 'C', c--;
cout<< "" << " " << "" <<endl;
for(int i=; i<; i++)
{
cout<< str[i] <<endl;
} return ;
}
A Mist of Florescence CodeForces - 989C(思维构造)的更多相关文章
- C. A Mist of Florescence ----- Codeforces Round #487 (Div. 2)
C. A Mist of Florescence time limit per test 1 second memory limit per test 256 megabytes input stan ...
- Codeforces Round #487 (Div. 2) A Mist of Florescence (暴力构造)
C. A Mist of Florescence time limit per test 1 second memory limit per test 256 megabytes input stan ...
- CF989C A Mist of Florescence 构造 思维好题 第八题
A Mist of Florescence time limit per test 1 second memory limit per test 256 megabytes input standar ...
- CF思维联系– Codeforces-989C C. A Mist of Florescence
ACM思维题训练集合 C. A Mist of Florescence time limit per test 1 second memory limit per test 256 megabytes ...
- CF989C A Mist of Florescence (构造)
CF989C A Mist of Florescence solution: 作为一道构造题,这题确实十分符合构造的一些通性----(我们需要找到一些规律,然后无脑循环).个人认为这题规律很巧妙也很典 ...
- Codeforces A Mist of Florescence
A Mist of Florescence 题目大意: 事先告诉你每种颜色分别有几个联通块,构造一个不超过 \(50*50\) 的矩形.用 \(A,B,C,D\) 四种颜色来对矩形进行涂色使它满足要求 ...
- Codeforces Round #487 (Div. 2) C - A Mist of Florescence
C - A Mist of Florescence 把50*50的矩形拆成4块 #include<bits/stdc++.h> using namespace std; ],b[]; ][ ...
- 【题解】CF989C A Mist of Florescence
[题解]CF989C A Mist of Florescence 题目大意: 让你构造一个\(n∗m\)矩阵,这个矩阵由4种字符填充构成,给定4个整数,即矩阵中每种字符构成的四联通块个数,\(n,m\ ...
- hdu4671 思维构造
pid=4671">http://acm.hdu.edu.cn/showproblem.php? pid=4671 Problem Description Makomuno has N ...
随机推荐
- python基础开发环境Pycharm的详细使用方法
PyCharm是由JetBrains打造的一款Python IDE(集成开发环境) 1. 创建Python文件 2. pycharm的操作界面 3. PyCharm修改字体大小的方式 4. pycha ...
- 41F继电器座的解剖与妙用
摘要:如果继电器不是焊在电路板上使用,就需要有个插座,这样方便接线,否则继电器的管脚是没法固定导线的.实际项目中使用了HF41F的继电器(宏发),在选择继电器座的时候,有一点感想,分享给大家.继电器是 ...
- 【Unity Shader】(八) ------ 高级纹理之立方体纹理及光线反射、折射的实现
笔者使用的是 Unity 2018.2.0f2 + VS2017,建议读者使用与 Unity 2018 相近的版本,避免一些因为版本不一致而出现的问题. [Unity Shader](三) -- ...
- 扩展Unity Inspector
Unity Editor下,可以在不改变原有布局的情况下扩展Inspect的界面. 在继承了Editor的类中,有两种实现方式: using UnityEditor; [CustomEditor(ty ...
- 005 -- Mysql数据库引擎特点分析
常用的数据库引擎的特点: ISAM: ISAM是一个定义明确且历经时间考验的数据表格管理方法,它在设计之时就考虑到数据库查询次数要远大于更新次数.因此,ISAM执行读取操作的速度很快,而且不占用大量的 ...
- phpcmsv9广告版位调用方法
<div class="ya"> <?php // pc:get 使用sql语句获取指定条件的广告版位! ?> {pc:get sql="SELE ...
- 路由器终端常用linux命令汇总(持续更新)
ls:显示文件名与相关属性 ls -al;ls -l;ls -a 第一列: d:表示目录,dir. -:表示文件. l:表示链接文件,linkfile. 接下来的字符三个为一组,且均为rwx这3个字母 ...
- Influxdb配置文件详解---influxdb.conf
官方介绍:https://docs.influxdata.com/influxdb/v1.2/administration/config/ 全局配置 1 2 reporting-disabled = ...
- 半年收入超2亿RMB 独立游戏开发者的艰苦创业路
一款叫做<监狱建筑师>的模拟经营游戏,目前在Steam平台获得了3000万美元(近2亿元)以上的收入.这款游戏由英国独立工作室Introversion Software发布,而团队最困难的 ...
- git实践笔记
title: git实践笔记 date: 2016-10-15 18:40:26 tags: [Git] categories: [Tool,Git] --- 概述 本文记录常用 git 的功能和命令 ...