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之间的数字,甲知道两数之和,乙知道两数之积,甲问乙:“你知道是哪两个数吗?”乙说:“不知道”.乙问甲:“你知道是哪两个数吗?”甲说:“也不知道”.于是,乙说:“那我知道了”, ...
随机推荐
- 记录以下docker的基本命令
docker search xxx(tag) 在OFFICIAL上ok的是官方镜像 这里也可以去dockerhub上面看到 搜索xxx镜像docker images查看本地所安装的 ...
- vue 调用摄像头拍照以及获取相片本地路径(实测有效)
在学习这个的时候有一点前提:这是针对手机功能的,所以最重要的是要用手机进行实时调试 包含图片的增加和删除功能 <template> <div> <!--照片区域--> ...
- MySQL系列
目录: 一.初识数据库 二.库相关操作 三.表相关操作 四.记录相关操作 五.数据备份.pymysql模块 六.视图.触发器.事务.存储过程.函数 七.ORM框架SQLAlchemy 八.索引原理与慢 ...
- 主流图库对比以及JanusGraph入门
1.Overall Comparison Name Neo4j JanusGraph Giraph Jena 1.Compute Framework Yes Yes Yes 2.External Co ...
- Go smtp发送邮件,带附件
package main import ( "net/smtp" "bytes" "time" "io/ioutil" ...
- ztree设置节点checked,选中某节点等相关操作
ztree设置节点checked,选中某节点等相关操作 1.根据id获取树的某个节点: var zTree = $.fn.zTree.getZTreeObj("mytree"); ...
- 百度网盘免VIP全速下载!
不知道大家在用百度网盘下载文件时会不会遇到这样一个问题: 过分! 太过分了! 100M的宽带你就给我限速到20KB/s... 当然 解决办法有很多 1.充钱(这辈子都不可能的) ······ 百度上有 ...
- vue常用属性
关键词:filters | 自定义过滤器 (首字母大写) <p>{{ msg | capitalize }}</p> filters: { capitalize: funct ...
- [LeetCode] Keys and Rooms 钥匙与房间
There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, an ...
- Servlet 自定义标签
自定义标签 1)用户定义的一种jsp标记,当一个含有自定义标签的jsp页面被jsp引擎编译成servlet时,tag标签被转化成了对一个称为 标签处理类 的对象的操作.于是,当jsp页面被jsp引擎转 ...