Educational Codeforces Round 68 (Rated for Div. 2)---B
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的更多相关文章
- Educational Codeforces Round 68 (Rated for Div. 2)补题
A. Remove a Progression 签到题,易知删去的为奇数,剩下的是正偶数数列. #include<iostream> using namespace std; int T; ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- Educational Codeforces Round 43 (Rated for Div. 2)
Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...
随机推荐
- 最新大型三甲医疗信息管理系统软件C#体检系统成熟PEIS源码BS架构NET网络版本
查看体检系统演示 本源码是成熟在用大型医疗信息管理系统体检系统PEIS源码BS架构,开发语言是 asp.net c#,数据库是sqlserver2008r2,开发工具vs2010. 功能模块: 1.前 ...
- JS基础_强制类型转换-Number
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 【UVA1505】 Flood-it!(IDA*)
题目链接 IDA*,估价函数为当前除了左上角的连通块以外颜色的种类数,因为每次最多消去一个颜色. 维护位于当前连通块的边缘但颜色不同的点,每次从这些点拓展就行. #include <cstdio ...
- Android 低功耗蓝牙BLE 开发注意事项
基本概念和问题 1.蓝牙设计范式? 当手机通过扫描低功耗蓝牙设备并连接上后,手机与蓝牙设备构成了客户端-服务端架构.手机通过连接蓝牙设备,可以读取蓝牙设备上的信息.手机就是客户端,蓝牙设备是服务端. ...
- Vue 默认IIS站点配置
// Vue 默认IIS站点配置 module.exports = { baseUrl: '/SG/', }
- python字符串的常见方法
1.join方法:拼接字符串------->str a = "你是风儿我是沙"b = "@".join(a)print(b)>>>你@是 ...
- MyCAT+MySQL搭建高可用企业级数据库集群视频课程
原文地址:https://www.guangboyuan.cn/mycatmysql%E6%90%AD%E5%BB%BA%E9%AB%98%E5%8F%AF%E7%94%A8%E4%BC%81%E4% ...
- 快速为不同 Git 平台配置用户
在 ~ 目录下创建 config 文件可以为项目配置默认的用户信息,但如果希望经常切换,那么最好就是通过命令为项目单独设置用户. 我使用的 shell 是 zsh, 所以我在 ~/.zshrc 文件中 ...
- QtCreator常用快捷键
1)帮助文件:F1 (光标在函数名字或类名上,按 F1 即可跳转到对应帮助文档,查看其详细用法) 2).h 文件和对应.cpp 文件切换:F4 3)编译并运行:Ctrl + R 4)函数声明和定义(函 ...
- Python入门篇-基础语法
Python入门篇-基础语法 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.编程基础 1>.程序 一组能让计算机识别和执行的指令. 程序 >.算法+ 数据结构= 程 ...