摘要: 度度熊喜欢着喵哈哈村的大明星——星星小姐。 为什么度度熊会喜欢星星小姐呢? 首先星星小姐笑起来非常动人,其次星星小姐唱歌也非常好听。 但这都不是最重要的,最重要的是,星星小姐拍的一手好代码! 于是度度熊关注了星星小姐的贴吧。 一开始度度熊决定每天都在星星小姐的贴吧里面签到。 但是度度熊是一个非常健忘 阅读全文
posted @ 2018-03-04 23:14 StarHai 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 我们将A省简化为由N个城市组成,某些城市之间存在双向道路,而且A省的交通有一个特点就是任意两个城市之间都能通过道路相互到达,且在不重复经过城市的情况下任意两个城市之间的到达方案都是唯一的。聪明的你一定已经发现,这些城市构成了树这样一个结构。 现在百度陆续开了许许多多的... 阅读全文
posted @ 2018-03-04 23:07 StarHai 阅读(189) 评论(0) 推荐(0) 编辑
摘要: I hope you know the beautiful Union-Find structure. In this problem, you’re to implement somethingsimilar, but not identical.The data ... 阅读全文
posted @ 2018-03-04 23:02 StarHai 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 度度熊是一个喜欢计算机的孩子,在计算机的世界中,所有事物实际上都只由0和1组成。 现在给你一个n*m的图像,你需要分辨他究竟是0,还是1,或者两者均不是。 图像0的定义:存在1字符且1字符只能是由一个连通块组成,存在且仅存在一个由0字符组成的连通块完全被1所包围。 图... 阅读全文
posted @ 2018-03-04 23:00 StarHai 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 車是中国象棋中的一种棋子,它能攻击同一行或同一列中没有其他棋子阻隔的棋子。一天,小度在棋盘上摆起了许多車……他想知道,在一共N×M个点的矩形棋盘中摆最多个数的車使其互不攻击的方案数。他经过思考,得出了答案。但他仍不满足,想增加一个条件:对于任何一个車A,如果有其他一个... 阅读全文
posted @ 2018-03-04 22:54 StarHai 阅读(208) 评论(0) 推荐(0) 编辑
摘要: The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he ... 阅读全文
posted @ 2018-03-04 22:45 StarHai 阅读(155) 评论(0) 推荐(0) 编辑
摘要: We have a 3×3 grid. A number ci,j is written in the square (i,j), where (i,j) denotes the square at the i-th row from the top and the ... 阅读全文
posted @ 2018-03-04 22:41 StarHai 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Find the maximum possible sum of the digits (in base 10) of a positive integer not greater than N.Constraints1≤N≤1016N is an integer.I... 阅读全文
posted @ 2018-03-04 22:35 StarHai 阅读(230) 评论(0) 推荐(0) 编辑
摘要: An adult game master and N children are playing a game on an ice rink. The game consists of K rounds. In the i-th round, the game mast... 阅读全文
posted @ 2018-03-04 22:24 StarHai 阅读(246) 评论(0) 推荐(0) 编辑