2016年11月16日

最大公因数和最小公倍数

摘要: 1 # include 2 using namespace std; 3 //辗转相除法 4 int gcd(int a, int b) { 5 if (b == 0) return a; 6 return gcd(b, a%b); 7 } 8 9 int lcm(int a, int b) { 10 return a*b / gcd(a, b)... 阅读全文

posted @ 2016-11-16 19:39 mkfoy 阅读(257) 评论(0) 推荐(0)

HDU 2037 今年暑假不AC

摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct show 8 { 9 int start; 10 int end; 11 }; 12 bool cmp(show a, show b) { 13 return a.end >n&&n!=0)... 阅读全文

posted @ 2016-11-16 19:09 mkfoy 阅读(138) 评论(0) 推荐(0)

归并排序

摘要: 注没有排序那一步,在分解的时候你就把它分解成一个个的,相当于排好了序的,所以直接归并就行了 阅读全文

posted @ 2016-11-16 17:08 mkfoy 阅读(193) 评论(0) 推荐(0)

导航