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. 45.Sort List(链表排序)

    Level:   Medium 题目描述: Sort a linked list in O(n log n) time using constant space complexity. Example ...

  2. JAVA 实现Jacob语音播报

    准备工作:下载Jar 链接:https://pan.baidu.com/s/1edskJjYrCiefVJ7l3Ul9kQ     提取码:6dg9 ---导入jar 解压jar包,将jacob.ja ...

  3. 简易的富文本编辑器WangEditor

    网址http://www.wangeditor.com/ var E = window.wangEditor; var editor = new E('#editor') // 或者 var edit ...

  4. Codeforces 1188A 构造

    题意:给你一颗树,树的边权都是偶数,并且边权各不相同.你可以选择树的两个叶子结点,并且把两个叶子结点之间的路径加上一个值(可以为负数),问是否可以通过这种操作构造出这颗树?如果可以,输出构造方案.初始 ...

  5. Codeforces 1186F - Vus the Cossack and a Graph 模拟乱搞/欧拉回路

    题意:给你一张无向图,要求对这张图进行删边操作,要求删边之后的图的总边数 >= ceil((n + m) / 2), 每个点的度数 >= ceil(deg[i] / 2).(deg[i]是 ...

  6. Python技能树

    本博客Python内容的索引,以后就照着它写了.

  7. Myeclipse 崩溃闪退 Java was started but returned exit code =-1

    出现如上图所述情况的原因可能是因为虚拟机jdk和myEclipse配置文件中的vm地址发生冲突报出的错误 第一种解决办法:只需要将你jdk文件下的bin目录下的javaw.exe文件的全部路径复制到M ...

  8. jsp标签的介绍

    cankao:http://www.cnblogs.com/xdp-gacl/p/3788369.html jsp常用的标签有以下3个 1.<jsp:include>标签 2.<js ...

  9. 树莓派上安装boost库

    一.安装boost库 sudo apt-get install libboost-dev aptitude search boost 二.编写测试代码 #include <iostream> ...

  10. POJ A Plug for UNIX (最大流 建图)

    Description You are in charge of setting up the press room for the inaugural meeting of the United N ...