随笔分类 -  ACM-DP

摘要:Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某... 阅读全文
posted @ 2018-03-23 20:49 StarHai 阅读(328) 评论(0) 推荐(0)
摘要:車是中国象棋中的一种棋子,它能攻击同一行或同一列中没有其他棋子阻隔的棋子。一天,小度在棋盘上摆起了许多車……他想知道,在一共N×M个点的矩形棋盘中摆最多个数的車使其互不攻击的方案数。他经过思考,得出了答案。但他仍不满足,想增加一个条件:对于任何一个車A,如果有其他一个... 阅读全文
posted @ 2018-03-04 22:54 StarHai 阅读(252) 评论(0) 推荐(0)
摘要:You are given a rectangular field of n × m cells. Each cell is either empty or impassable (contains an obstacle). Empty cells are marked with '.', imp 阅读全文
posted @ 2018-01-29 20:22 StarHai 阅读(200) 评论(0) 推荐(0)
摘要:Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game a... 阅读全文
posted @ 2018-01-29 19:56 StarHai 阅读(197) 评论(0) 推荐(0)