随笔分类 - 贪心
摘要:hdu 2037 今年暑假不AC (http://acm.hdu.edu.cn/showproblem.php?pid=2037)比较经典的贪心问题之一,以结束时间排序,如果下一个时间的开始时间大于等于上一个事件结束时间,那么结果就加一。View Code 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<algorithm> 5 using namespace std; 6 struct node 7 { 8 int start; 9 int end;1
阅读全文
摘要:B. Taxitime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists of si friends (1 ≤ si ≤ 4), and they
阅读全文