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. shell-基础2-字符串文本处理${}

    一.为什么使用${}引用变量 1.$a和${a}的效果与区别 因为个别特殊字符会影响正常引用,所以需要使用${}引用变量,加花括号是为了帮助解释器识别变量的边界 $a和${a}效果一样,当变量后面连接 ...

  2. 使用vue-cookies

    1.在项目中安装vue-cookies: npm install vue-cookies --save 或 yarn add vue-cookies --save 2.全局引用: //在 main.j ...

  3. vue项目在ie中空白问题

    vue项目在ie浏览器中出现空白,f12打开后发现在body下面就只有一个div盒子,因此我们可以猜测就是js没有引入导致的,所有网上看了一些相关的才知道,在ie中无法解析es6或者版本更高的语法,所 ...

  4. Appscan漏洞之Authentication Bypass Using HTTP Verb Tampering

    本次针对 Appscan漏洞 Authentication Bypass Using HTTP Verb Tampering(HTTP动词篡改导致的认证旁路)进行总结,如下: 1. Authentic ...

  5. Solr+ik分词支持特殊符号分词

    在工具类(CharacterUtil.java)里,找到方法 identifyCharType,加入以下代码: } else if (ub == Character.UnicodeBlock.GREE ...

  6. HashMap,HashSet

    HashMap,HashSet 摘自:https://www.cnblogs.com/skywang12345/p/3310887.html#a1 目录 一.    HashMap(键值对形式存取,键 ...

  7. Linux 新手入门教程

    Linux 新手入门教程 1991年10月5日,Linus Torvalds 在互联网上发布消息,宣布他自己开发的内核系统诞生了.他将内核源代码保存在芬兰最大的 FTP 网站上,命名为 Linux,取 ...

  8. Windows性能计数器监控实践

    Windows性能计数器(Performance Counter)是Windows提供的一种系统功能,它能实时采集.分析系统内的应用程序.服务.驱动程序等的性能数据,以此来分析系统的瓶颈.监控组件的表 ...

  9. 【转】spring bean 卸载

    spring bean 卸载起因: 群里的一个朋友问到: 关于配置destory-method, springboot中 yml如何指定 首先介绍 bean卸载的三种形式 自定义destory-met ...

  10. mysql安装好需要启动和停止服务

    启动mysql: mysql.server start 停止服务:mysql.server stop