C# - 2017微软校园招聘笔试题 之 MS Recognition[待解决]
MS Recognition
在线提交:
hihoCoder 1402 http://hihocoder.com/problemset/problem/1402
类似:
OpenJudge - I:PKU Zealots http://poj.openjudge.cn/campus2016/I/
描述
Given an image containing only two kinds of capital letters, ‘M’ and
‘S’, can you tell how many of each letter are there in the image? Note
that the letters may be of different sizes and may be rotated.
输入
The first line contains two integers H and W, indicating the height
and weight of the image. (1 <= H, W <= 500)Then follows an H x W matrix indicating the image.
‘.’ indicates the pixel is empty and ‘#’ indicates the pixel is part
of a letter.It is guaranteed that:
The letters are actually in Microsoft Yahei font.
Each letter consists of at least 20 pixels.
Different letters are at least 2 pixels away from each other.
输出
Two integers, the number of ‘M’ letters and the number of ‘S’ letters.
样例输入
50 50
………………………………………………
……………………………………………….
……………………………………….#…….
………………………..###……….##…….
…….##………………##.##…….#………
…….##………………#…………##………
……###…….#……….#………..##………
……####…..###………###…….######…
……#.##…..###……….####……………#…
……#.##….####…………##…………..#…
…..##..#…##.#………..#…#…………##…
…..##..#..##.##……..#####……….##…..
…..#…#.##..##……………………………
…..#…###…#…………………………….
…..#…###…#…………………………….
………##…##………………….##……….
…………..##…..##…………..###……….
………………..###…………###…………
……………….###………….##………….
………………###………….##…………..
……………..###…………..##…………..
…………….###……###…….########…….
……………###…..#####……..########……
…………..###…########……………##…..
………….###..#####..##…………….##…..
…………########….###…………….##…..
………..#######……##…..##………###…..
…………###………##….###…….####……
…………………..###…###…….###……..
…….#……………##…###……………….
…..####………….###..###………………..
…######………….##..###…………………
..####…………….######………………….
..###…………….######…………………..
.###……………..#####…….##……………
.###…………….#####……..######………..
.###……………..###………##########…….
..##########…………………..##…####……
..############………………….##…………
….###########………………….###……….
………….##…………………..###………
………….###…………………..###……..
………….###……………….#######……..
………….##…………….########………..
…………###…………….####……………
……….####………………######…………
…….######………………….######………
…….###………………………..##………
…………………………………………..
…………………………………………..
输入的图形变形了,下面附上截图:
样例输出
3 4
思路:
参考:
2017微软秋季校园招聘在线编程笔试4——1402 : MS Recognition - 简书
https://www.jianshu.com/p/6957bc1664f1
我来贴一个第四题的思路 - hihoCoder
http://hihocoder.com/discuss/question/3970
C# - 2017微软校园招聘笔试题 之 MS Recognition[待解决]的更多相关文章
- 2014 WAP校园招聘笔试题
2014 WAP校园招聘笔试题 Problem's Link: http://www.doc88.com/p-6751117015483.html WAP公司笔试题 We are planning ...
- google2013校园招聘笔试题(全国)
google2013校园招聘笔试题 1. 单项选择题1.1如果把传输速率定义为单位时间内传送的信息量(以字节计算)多少.关于一下几种典型的数据传输速率:1.使用USB2.0闪存盘,往USB闪存盘上拷贝 ...
- Microsoft 2013校园招聘笔试题及解答
Microsoft 2013校园招聘笔试题及解答 题目是自己做的,求讨论.吐槽.拍砖 1. Which of the following callingconvension(s) suppo ...
- Microsoft2013校园招聘笔试题
Microsoft2013校园招聘笔试题 继续求拍砖!!!! 1. You are managing the database of a book publichser, you currently ...
- 京东2017校园招聘笔试题 【第K个幸运数】
题目描述 4和7是两个幸运数字,我们定义,十进制表示中,每一位只有4和7两个数的正整数都是幸运数字. 前几个幸运数字为:4,7,44,47,74,77,444,447... 现在输入一个数字K,输出第 ...
- 九度OJ 1531 货币面值(网易游戏2013年校园招聘笔试题) -- 动态规划
题目地址:http://ac.jobdu.com/problem.php?pid=1531 题目描述: 小虎是游戏中的一个国王,在他管理的国家中发行了很多不同面额的纸币,用这些纸币进行任意的组合可以在 ...
- PPS2013校园招聘笔试题
转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/11473405 一.简答题 (1)一位老师有2个推理能力很强的学生,他告诉 ...
- Microsoft2013校园招聘笔试题及解答
继续求拍砖!!!! 1. You are managing the database of a book publichser, you currently store the book orders ...
- 2012Google校园招聘笔试题
1.已知两个数字为1~30之间的数字,甲知道两数之和,乙知道两数之积,甲问乙:“你知道是哪两个数吗?”乙说:“不知道”.乙问甲:“你知道是哪两个数吗?”甲说:“也不知道”.于是,乙说:“那我知道了”, ...
随机推荐
- 10分钟了解JSON Web令牌(JWT)
JSON Web Token(JWT)是目前最流行的跨域身份验证解决方案.虫虫今天给大家介绍JWT的原理和用法. 1.跨域身份验证 Internet服务无法与用户身份验证分开.一般过程如下. 1.用户 ...
- preventDefault()、stopPropagation()、return false 的区别
preventDefault() e.preventDefault()阻止浏览器默认事件 stopPropagation() e.stopPropagation()阻止冒泡 return false ...
- Centos7安装zabbix-agent
1.下载zabbix-agent wget https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.10 ...
- python之lambda函数
今天复习python,看见一个关于lambda函数的例子,在python中使用lambda在某些时候十分方便,因为不必为了实现某些简单功能而新建一个函数.但是有这么一个lambda实例令我有些疑惑,现 ...
- springboot排除exclude
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
- mysql基本命令总结
1.在Ubuntu上安装MYSQL sudo apt-get install mysql-server sudo apt-get install mysql-client 2.安装结束后,用命令验证是 ...
- RDSS和RNSS
RNSS英文全称Radio Navigation Satellite System,由用户接收卫星无线电导航信号,是一种卫星无线电导航业务,自主完成至少到4颗卫星的距离测量,进行用户位置,速度及航行参 ...
- 201771010126 王燕《面向对象程序设计(Java)》第十三周学习总结
实验十三 图形界面事件处理技术 实验时间 2018-11-22 1.实验目的与要求 (1) 掌握事件处理的基本原理,理解其用途: 事件源 (eventevent eventeventsource s ...
- UVALive 2474 Balloons in a Box(枚举)
https://vjudge.net/contest/277824#problem/A 尤其是模拟题,三思而后敲!!! 纠错了好久,主要还是没有处理好:单点若还未放气球,其他气球可以膨胀越过它(即可以 ...
- 20175324王陈峤宇 2018-2019-2《Java程序设计》结对编程项目-四则运算 第一周 阶段性总结
20175324王陈峤宇 2018-2019-2<Java程序设计>结对编程项目-四则运算 第一周 阶段性总结 需求分析 这次的结对作业是要求我们利用栈来设计一个计算器. 自动生成四则运算 ...