摘要:
使用动态规划解题,直接将区间以开始点排序,然后将不重叠的点的最大值+1以记录就可以了。直接在循环中记录了最大点,更简洁。 View Code 1 //#include 2 #include 3 #include 4 #include 5 using ... 阅读全文
2011年7月31日
摘要:
第一个使用贪心算法做的ACM题目O(∩_∩)O哈哈~。将兑换比从大到小排序,然后兑换直至完成,输出结果即可 View Code 1 #include 2 #include 3 #include 4 struct Exchange{ 5 int ro... 阅读全文
2010年10月16日
摘要:
本题解题时考虑每组数据出现情况中不够全面,在判断中使用break;导致在遇到类似 42 -:--:--0:23:32的数据时出现问题。由于遇到-:--:--时break,导致后面的数据无法输入,所以出错。切记注意慎用break,并注意break对后续输入的数据的影响。感谢CSDN的logiciel... 阅读全文
2010年8月23日
摘要:
Problem Description For products that are wrapped in small packings it is necessary that the sheet of paper containing the directions for use is fol... 阅读全文
摘要:
View Code 1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 int m,n; 7 while (cin>>m>>n) 8 { 9 ... 阅读全文