A Mist of Florescence CodeForces

题意:

让你构造一个图,使得A,B,C,D的个数为给定的个数,上下左右连通的算一个。

哎呀 看看代码就懂了。。emm。。很好懂的

#include <bits/stdc++.h>
using namespace std;
const int maxn = 10010, INF = 0x7fffffff;
char str[55][55];
int main()
{
    for(int i=0; i<50; i++)
        for(int j=0; j<50; j++)
            if(i<25)
                str[i][j] = 'A';
            else
                str[i][j] = 'B';
    int a, b, c, d;
    cin>> a >> b >> c >> d;
    a--, b--;
    for(int i=0; i<25; i+=2)
        for(int j=0; j<50; j+=2)
            if(b)
                str[i][j] = 'B', b--;
            else if(d)
                str[i][j] = 'D', d--;
    for(int i=27; i<50; i+=2)
        for(int j=0; j<50; j+=2)
            if(a)
                str[i][j] = 'A', a--;
            else if(c)
                str[i][j] = 'C', c--;
    cout<< "50" << " " << "50" <<endl;
    for(int i=0; i<50; i++)
    {
        cout<< str[i] <<endl;
    }

    return 0;
}
自己选择的路,跪着也要走完。朋友们,虽然这个世界日益浮躁起来,只要能够为了当时纯粹的梦想和感动坚持努力下去,不管其它人怎么样,我们也能够保持自己的本色走下去。
原文地址:https://www.cnblogs.com/WTSRUVF/p/9535493.html