摘要:
LeetCode All in One 题目讲解汇总(持续更新中...) 终于将LeetCode的大部分题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 如果各位看官们,大神们发现了任何错误,或是代码无法通过OJ,或是有更好的解法 阅读全文
摘要:
题意: 在一个n∗n的国际象棋的棋盘上放两个象,要求不能有位置同时被两个象攻击到,然后被一个象攻击到的位置上获得得分。(象放的位置也获得该位置得分),求得分的最大值。 题目描述 Gargari is jealous that his friend Caisa won the game from th 阅读全文
摘要:
C. Hacking Cypher time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus participates 阅读全文
摘要:
0-1 背包问题:给定 n 种物品和一个容量为 C 的背包,物品 i 的重量是 wi,其价值为 vi 。 问:应该如何选择装入背包的物品,使得装入背包中的物品的总价值最大? 分析一波,面对每个物品,我们只有选择拿取或者不拿两种选择,不能选择装入某物品的一部分,也不能装入同一物品多次。 解决办法:声明 阅读全文
摘要:
C. k-Tree time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. k-Tree time limit per test 1 阅读全文