题意:

让你构造一个图,使得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(思维构造)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. CF989C A Mist of Florescence 构造 思维好题 第八题

    A Mist of Florescence time limit per test 1 second memory limit per test 256 megabytes input standar ...

  4. 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 ...

  5. CF989C A Mist of Florescence (构造)

    CF989C A Mist of Florescence solution: 作为一道构造题,这题确实十分符合构造的一些通性----(我们需要找到一些规律,然后无脑循环).个人认为这题规律很巧妙也很典 ...

  6. Codeforces A Mist of Florescence

    A Mist of Florescence 题目大意: 事先告诉你每种颜色分别有几个联通块,构造一个不超过 \(50*50\) 的矩形.用 \(A,B,C,D\) 四种颜色来对矩形进行涂色使它满足要求 ...

  7. 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[]; ][ ...

  8. 【题解】CF989C A Mist of Florescence

    [题解]CF989C A Mist of Florescence 题目大意: 让你构造一个\(n∗m\)矩阵,这个矩阵由4种字符填充构成,给定4个整数,即矩阵中每种字符构成的四联通块个数,\(n,m\ ...

  9. hdu4671 思维构造

    pid=4671">http://acm.hdu.edu.cn/showproblem.php? pid=4671 Problem Description Makomuno has N ...

随机推荐

  1. 斐讯K2 PSG1218 刷机教程 基于Breed互刷 清除配置

    Padavan官方论坛http://www.right.com.cn/forum/thread-161324-1-1.html Breed官方文档http://www.right.com.cn/for ...

  2. 3、ObjectARX开发创建直线、圆、圆弧和修改对象属性

    一.本节课程 Arx二次开发创建直线.圆.圆弧和修改对象属性 二.本节要讲解的知识点 1.如何应用C++ ARX二次开发创建直线. 2.如何应用C++ ARX二次开发创建圆. 3.如何应用C++ AR ...

  3. [学习笔记]PCL使用心得

    最近开始做研究生毕设,有一部分因为没有什么好的思路,就把以前用过的PCL点云搬出来,重新用源码装了一遍PCL,一开始装的过程中没什么大问题,在后面用的时候碰到了很多小问题,特此记录. 1.PCL版本问 ...

  4. python属性访问

    1.python属性访问魔法方法: >>> class C: def __getattribute__(self,name): print("getattribute&qu ...

  5. python时间模块详解(time模块)

    time 模块 -- 时间获取和转换 time 模块提供各种时间相关的功能 在 Python 中,与时间处理有关的模块包括:time,datetime 以及 calendar 必要说明: 虽然这个模块 ...

  6. 【读书笔记】《Computer Organization and Design: The Hardware/Software Interface》(1)

    笔记前言: <Computer Organization and Design: The Hardware/Software Interface>,中文译名,<计算机组成与设计:硬件 ...

  7. Kafka科普系列 | Kafka中的事务是什么样子的?

    事务,对于大家来说可能并不陌生,比如数据库事务.分布式事务,那么Kafka中的事务是什么样子的呢? 在说Kafka的事务之前,先要说一下Kafka中幂等的实现.幂等和事务是Kafka 0.11.0.0 ...

  8. dirname命令详解

    基础命令学习目录首页 原文链接:https://blog.csdn.net/xiaofei125145/article/details/50620281 示例一 来自手册页的例子 $ dirname ...

  9. [!] Attempt to read non existent folder `***********`

    以前遇到过的问题,最近又出现了,问题单独列出,容易查找: $ pod install [!] Attempt to read non existent folder `/Users/galahad/D ...

  10. 以符合人类阅读的方式打印php数组【转载】

    在程序开发过程中:打印数据进行查看调试是非常频繁的:如果没有一种易于阅读的样式那是相当痛苦的: 先定义一个数组: 1 2 3 4 5 6 7 8 9 $array=array(     't0'=&g ...