A Mist of Florescence

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

Examples

input

5 3 2 1

output

4 7

DDDDDDD

DABACAD

DBABACD

DDDDDDD

input

50 50 1 1

output

4 50

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

ABABABABABABABABABABABABABABABABABABABABABABABABAB

BABABABABABABABABABABABABABABABABABABABABABABABABA

DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

input

1 6 4 5

output

7 7

DDDDDDD

DDDBDBD

DDCDCDD

DBDADBD

DDCDCDD

DBDBDDD

DDDDDDD

Note

In the first example, each cell of Amaranths, Begonias and Centaureas forms a connected component, while all the Dianthuses form one.

我不就是读不懂英文题面吗???至于这样吗?
所以比赛的时候问了一下 $Zero$ 然后他告诉我了大概意思。。。
#并没有告诉我每个联通块个数不超过 100
####(大家可以想想这是个啥不可做题。。。。)
##而且我还以为矩形大小是题目规定的。。。。更不可做。。。
当场去世。。。。
(然后比赛打到一半开开心心的出去吃面去了。。。。面真好吃233)

看一眼代码就知道这是一道**题了。。。
得知数据范围的我很生气。。。机房调试都没有当场 1A 的啊。。

不好意思打扰了。。。


#include<bits/stdc++.h>
using namespace std;
char mapp[55][55];
int A, B, C, D; inline void prepare()
{
A--; B--; C--; D--; for(int i = 1; i <= 24; ++i)
for(int j = 1; j <= 24; ++j)
mapp[i][j] = 'A'; for(int i = 1; i <= 24; ++i)
for(int j = 25; j <= 48; ++j)
mapp[i][j] = 'B'; for(int i = 25; i <= 48; ++i)
for(int j = 1; j <= 24; ++j)
mapp[i][j] = 'C'; for(int i = 25; i <= 48; ++i)
for(int j = 25; j <= 48; ++j)
mapp[i][j] = 'D';
} inline void Draw()
{
int i = 2, j = 0;
while(B){
B--;
if(j <= 18) j += 2;
else{i += 2; j = 2;}
mapp[i][j] = 'B';
} i = 2; j = 24;
while(A){
A--;
if(j <= 42) j += 2;
else{i += 2; j = 26;}
mapp[i][j] = 'A';
} i = 26; j = 0;
while(D){
D--;
if(j <= 18) j += 2;
else{i += 2; j = 2;}
mapp[i][j] = 'D';
} i = 26; j = 24;
while(C){
C--;
if(j <= 42) j += 2;
else{i += 2; j = 26;}
mapp[i][j] = 'C';
}
} inline void print()
{
printf("48 48\n");
for(int i = 1; i <= 48; ++i){
for(int j = 1; j <= 48; ++j)
printf("%c", mapp[i][j]);
printf("\n");
} } int main()
{
scanf("%d%d%d%d", &A, &B, &C, &D);
prepare();
Draw();
print();
return 0;
}

Codeforces A Mist of Florescence的更多相关文章

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

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

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

  4. CF989C A Mist of Florescence (构造)

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

  5. 【题解】CF989C A Mist of Florescence

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

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

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

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

  8. Codeforces 989C - A Mist of Florescence

    传送门:http://codeforces.com/contest/989/problem/C 这是一个构造问题. 构造一张网格,网格中的字符为’A’.’B’.’C’.’D’,并且其连通块的个数分别为 ...

  9. A Mist of Florescence CodeForces - 989C(思维构造)

    题意: 让你构造一个图,使得A,B,C,D的个数为给定的个数,上下左右连通的算一个. 哎呀 看看代码就懂了..emm..很好懂的 #include <bits/stdc++.h> usin ...

随机推荐

  1. 2019-4-8 zookeeper学习笔记

    zookeeper学习 ZooKeeper集合中的节点 让我们分析在ZooKeeper集合中拥有不同数量的节点的效果. 如果我们有单个节点,则当该节点故障时,ZooKeeper集合将故障.它有助于“单 ...

  2. Timus 1712. Cipher Grille 题解

    版权声明:本文作者靖心,靖空间地址:http://blog.csdn.net/kenden23/.未经本作者同意不得转载. https://blog.csdn.net/kenden23/article ...

  3. Spring学习笔记(13)——aop原理及拦截器

    原理 AOP(Aspect Oriented Programming),也就是面向方面编程的技术.AOP基于IoC基础,是对OOP的有益补充. AOP将应用系统分为两部分,核心业务逻辑(Core bu ...

  4. DB2临时表空间的作用

    临时表空间分为系统临时表空间和用户临时表空间 系统临时表空间用来存储各种数据操作(排序.重组表.创建索引.连接表)中所需的内部临时数据,虽然可以创建任意多个系统临时表空间,但建议用户只使用大多数表所使 ...

  5. SpringBoot2.x整合Shiro(一)

    一:什么是ACL和RBAC: ACL: Access Control List 访问控制列表 以前盛行的一种权限设计,它的核心在于用户直接和权限挂钩 优点:简单易用,开发便捷 缺点:用户和权限直接挂钩 ...

  6. Java数组遍历

    1.数组声明格式: 数据类型 [] 数组名 = new 数据类型[长度]: 数组长度一旦确定无法更改. 数组里的数据必须是相同类型或自动向上转型后兼容的类型 2.数组遍历 //一维数组 String ...

  7. device tree DTB DTC 相互转换

    DTB --> DTS ./dtc -I dtb -O dts *.dtb -o *.dts DTS -> DTB ./dtc -I dts -O dtb -o test.dtb test ...

  8. 使用python开启你的opencv之旅---图像的读入,存储

    python的便捷是如此的引人着迷,而opencv给python提供的接口使我们能够使用python来快速验证我们的想法,或者与别的模块快速结合,在这个系列文章我会通过jupyter notebook ...

  9. Welcome to MarkdownPad 2

    Welcome to MarkdownPad 2 MarkdownPad is a full-featured Markdown editor for Windows. Built exclusive ...

  10. Git中.gitignore文件不起作用

    Git中.gitignore文件不起作用的解决以及Git中的忽略规则介绍   在Studio里使用Git管理代码的过程中,可以修改.gitignore文件中的标示的方法来忽略开发者想忽略掉的文件或目录 ...