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. 41.Validate Binary Search Tree(判断是否为二叉搜索树)

    Level:   Medium 题目描述: Given a binary tree, determine if it is a valid binary search tree (BST). Assu ...

  2. MariaDB学习笔记(一)

    一.数据类型:1.整数类型: TINYINT:1Byte SMALLINT:2Byte MEDIUMINT:3Byte INT:4Byte INTEGER:4Byte BIGINT:8Byte 2.浮 ...

  3. 2018-8-10-上传代码-CodePlex

    title author date CreateTime categories 上传代码 CodePlex lindexi 2018-08-10 19:16:51 +0800 2018-2-13 17 ...

  4. Nginx 常用基础模块

    目录 Nginx 常用基础模块 Nginx日志管理 nginx日志切割 Nginx目录索引 Nginx状态监控 Nginx访问控制 Nginx访问限制 Nginx 请求限制配置实战 Nginx Loc ...

  5. python基础--逻辑运算

    #and or not#and 且 :两边都为真才是真#or 或:一个真就是真(一真为真)#ont 非:相反#优先级:1.not>and>or#同一优先级由左向右以此计算!#列子:prin ...

  6. ORA-20782: Creating GGS_DDL_RULES

    在11g数据库上安装goldengate,运行@ddl_setup.sql时有如下错误 ERROR at line 1: ORA-20782: Creating GGS_DDL_RULES table ...

  7. Bootstrap 小功能

    <div class="container"> <div class="navbar-header"> <button type= ...

  8. 1、selenium 8大元素定位方式

    元素定位方式: id name css class_name tag_name partial_link link_text : driver. find_element_by_link_text(& ...

  9. ubuntu Oracle SQL Developer 安装

    一. 官网下载oracle 安装包 二.下载完毕后,检查你的Ubuntu是否安装了tar和alien sudo apt-get install tar sudo apt-get install ali ...

  10. Docker 镜像添加模块

    Docker 镜像添加模块   1. 使用root用户进入一个新容器,不要用 --rm .否则退出容器的时候,容器没有了 docker run --user 0 -it --name superman ...