摘要: 贪心算法 1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 using namespace std; 5 6 #define REP(n) for(int o=0;o<n;o++) 7 8 bool Do() { 9 阅读全文
posted @ 2016-03-05 14:14 OhYee 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 鸡兔同笼 注意各种Error情况 #include <cstdio> #include <algorithm> #include <cstring> using namespace std; #define REP(n) for(int o=0;o<n;o++) bool Do() { int n, 阅读全文
posted @ 2016-03-05 13:50 OhYee 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 打表 要注意不到7月前和8月后的情况 同时注意“0号”等特殊情况 1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 using namespace std; 5 6 #define REP(n) for(int o=0 阅读全文
posted @ 2016-03-05 13:32 OhYee 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 贪心算法 如果在类中定义自定义类型对应sort的比较函数,要注意再比较函数前加上static。说明该函数是静态函数,在内存中占用固定的内存。 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 5 #define R 阅读全文
posted @ 2016-03-05 13:30 OhYee 阅读(257) 评论(0) 推荐(0) 编辑