7.30 团队赛比赛总结

今天打了一场团队赛,从12点到5点,虽然之前也打过几场,但感觉这场还蛮有意思的。首先,我们是分散的打法,一人看了一个题,我们都不怎么熟悉文件式输入和输出,也没怎么在意。然后有意思的事发生了,虽然感觉自己挺有自信,结果接二连三的wa的三个题,这波是听取wa声一片,我们还觉得是自己优化细节有问题,继续改还是wa,而且全是wa在第一个样例上,我们直接疑惑了,然后就一起看一道题了。几乎改到不能再改了,还是wa在第一个样例,这时我们才开始看到是文件类的输入和输出,虽然以前遇见过,但没太在意,这次狠狠的打脸了(知道错了)。当我们做出来第一个题时几乎都过去两个小时了,题目上是满江红,之后我们才慢慢开始追赶,最大的阻碍解决掉之后又一起冲出来几个题,就是罚时高的离谱。总之,感觉时间过的还蛮快的,大家一起做喜欢的事情,一起解决问题是一件很快乐的事情,无论是wa之后的讨论和鼓励,ac之后的成就和喜悦,这就是团队赛的魅力吧。ps:这次开放性和创造性的题挺多的,主要是理解题意,真正读懂和理解才能做出题,光靠套路和模板还真不一定好用。
反思:最大的问题就是没注意文件输入输出(这次学会了),还有英语阅读理解需要提高,阅读速度需要提高,相信队友,一起加油就完事了!
最后放个我喜欢的题吧
题干:
B. Black and White
The jury has a great artistic idea — to create a rectangular panel out of a huge pile of black and white
squares of the same size. The panel should have exactly b 4-connected areas made of black tiles, and w
4-connected areas made of white tiles.
Remember, a 4-connected area of some color is a maximal set of the panel tiles such that:
• any two tiles of the area share the same color;
• for any two tiles of the area there is a tile sequence connecting them, such that any two consecutive
tiles of the sequence share a common side.
In addition to the artistic idea, the jury has already developed a program that produces design of the panel. But since this problem is about art, any new solution is extremely important for the jury.
Input
The only line of the input file contains two integers b and w — number of black and white areas
(1 ≤ b, w ≤ 1000).
Output
The first line of the output file should contain the picture sizes r and c — the number of rows and columns
(1 ≤ r, c ≤ 100 000). This line should be followed by r lines of c symbols each. Each symbol should be
either ‘@’ (for black tile) or ‘.’ (for white one). There should be no more than 100 000 tiles in the panel.
Example
black.in black.out
2 3 6 7
@@@@@@@
@.@@@@@
@@…@@
@@@@@@@

@@@@@@@
题意:大概是相邻的颜色是一整块,然后要输出b个黑的整块和w个白的整块
思路:可以构建,可以建两列,如果b,w相等,那么可以隔一行一种;如果不相等,可以补齐,用一整块少的颜色分隔多的颜色多个,等b和w相同后每隔一行输出一种颜色。

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <map>
#include <cstring>
#include <algorithm>
#include <string>
#define MAX 100000
using namespace std;
const int maxn = 1e5+10;
int vis[500],vis2[500];
int main()
{
	//文件输入和输出
    freopen("black.in","r",stdin);
    freopen("black.out","w",stdout);
    int n,m;
    scanf("%d %d",&n,&m);//黑 白
    int t=max(n,m);
    if(n>=m)// 黑的多或相等
    {
        printf("%d 2\n",t*2);
        int c=n-m;
        for(int i=1;i<=2*c;i++)//少的分隔多的,少的是一整块
        {
            if(i%2==1)
                printf("..\n");
            else
                printf("@.\n");
        }
        for(int i=1;i<=t*2-2*c;i++)//b和w相等
        {
            if(i%2==1)
                printf("..\n");
            else
                printf("@@\n");
        }
    }
    else//正好反过来
    {
        printf("%d 2\n",t*2);
        int c=m-n;
        for(int i=1;i<=2*c;i++)
        {
            if(i%2==1)
                printf("@@\n");
            else
                printf(".@\n");
        }
        for(int i=1;i<=t*2-2*c;i++)
        {
            if(i%2==1)
                printf("@@\n");
            else
                printf("..\n");
        }
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值