http://codeforces.com/contest/1194/problem/B

 /* */
# include <bits/stdc++.h>
using namespace std; int r[], c[];
string s[]; int main()
{
int n, m, q;
scanf("%d", &q);
while( q-- )
{
scanf("%d %d", &n, &m);
for(int i=; i<n; i++ )
cin>>s[i];
int cnt = ;
for( int i=; i<n; i++ )
{
cnt=;
for( int j=; j<m; j++ )
{
if( s[i][j]=='.' )
cnt++;
}
r[i] = cnt;
}
for( int j=; j<m; j++ )
{
cnt = ;
for( int i=; i<n; i++ )
{
if( s[i][j]=='.' )
cnt++;
}
c[j] = cnt;
}
int ans = ;
for( int i=; i<n; i++ )
{
for(int j=; j<m; j++ )
{
int temp = r[i]+c[j];
if( s[i][j]=='.' )
temp--;
ans = min(ans, temp);
}
}
printf("%d\n", ans);
}
return ;
}

Educational Codeforces Round 68 (Rated for Div. 2)---B的更多相关文章

  1. Educational Codeforces Round 68 (Rated for Div. 2)补题

    A. Remove a Progression 签到题,易知删去的为奇数,剩下的是正偶数数列. #include<iostream> using namespace std; int T; ...

  2. Educational Codeforces Round 68 (Rated for Div. 2) C. From S To T (字符串处理)

    C. From S To T time limit per test1 second memory limit per test256 megabytes inputstandard input ou ...

  3. Educational Codeforces Round 68 (Rated for Div. 2) D. 1-2-K Game (博弈, sg函数,规律)

    D. 1-2-K Game time limit per test2 seconds memory limit per test256 megabytes inputstandard input ou ...

  4. Educational Codeforces Round 68 (Rated for Div. 2)D(SG函数打表,找规律)

    #include<bits/stdc++.h>using namespace std;int sg[1007];int main(){ int t; cin>>t; while ...

  5. Educational Codeforces Round 68 (Rated for Div. 2)-D. 1-2-K Game

    output standard output Alice and Bob play a game. There is a paper strip which is divided into n + 1 ...

  6. Educational Codeforces Round 68 (Rated for Div. 2)-C-From S To T

    You are given three strings ss, tt and pp consisting of lowercase Latin letters. You may perform any ...

  7. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  8. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  9. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

随机推荐

  1. Redis安装--CentOS7上安装Redis

    echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!!! 1.R ...

  2. iOS - WebRTC 自编译(音视频即时通讯开源库)

    什么是WebRTC? WebRTC,名称源自网页实时通信(Web Real-Time Communication)的缩写,简而言之它是一个支持网页浏览器进行实时语音对话或视频对话的技术.是谷歌2010 ...

  3. 浅谈对BFC的认识,以及用bfc解决浮动问题

    我们在前端的学习过程中常常会遇到BFC,用BFC来解决一些margin塌陷.margin合并清理浮动流的问题 那么问题来了,我们所说的BFC到底是个什么东西呢: 什么是BFC BFC(Block Fo ...

  4. Vscode选中变量高亮问题

    前言 vscode的默认变量选中全局高亮根本看不清楚下一个变量高亮在哪...... 如下图. 框的颜色实在是差强人意. 流程 (1)安装插件:highlight-icemode (2)配置插件:打开用 ...

  5. MySQL DataType--日期格式

    在MySQL中,无论是字符串转换为时间还是时间转换为字符串,都需要使用到时间格式: %a 缩写星期名 %b 缩写月名 %c 月,数值 %D 带有英文前缀的月中的天 %d 月的天,数值(00-31) % ...

  6. visual studio 应用场景

  7. CentOS上使用ntfs-3g挂载NTFS分区

    U盘做过系统盘,是NTFS格式的,Centos7竟然不识别,而且因为一些原因,我的服务器没有联网,只能用U盘 查过资料才知道Centos7上默认是不支持挂载NTFS格式的分区的,需要安装ntfs-3g ...

  8. mybatis中对数据表操作的四种语法

    查询数据(select) select...from...where... 如:查询学生表中学号为某数的学生的全部信息 select * from stu where id=#{id} 增加数据(in ...

  9. kvm虚拟化环境中的时区设置

    guest OS时间保持 kvm技术是全虚拟化,guest OS并不需要做修改就可以直接运行,然而在计时方面却存在问题,guest OS计时的一种方式是通过时钟中断计数,进而换算得到,但host产生的 ...

  10. kubelet 参数详解

    kubelet 参数详解 基本参数 --allow-privileged=true #允许容器请求特权模式 --anonymous-auth=false #不允许匿名请求到 kubelet 服务(默认 ...