![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
周小敬
程序员哦
展开
-
hdu2037
#include #include #include using namespace std;struct Time{int start,end;};void Swap(Time &a,Time &b){if(a.end>b.end)swap(a,b);}int main(){int n,i,j,cnt,mark;while(cin>原创 2016-12-31 11:54:06 · 166 阅读 · 0 评论 -
N皇后问题
回溯法求n皇后问题1、思路分析采用回溯法,逐行确定满足条件“皇后”位置,再排除同列同一斜线上的位置。 * --- --- * ...原创 2019-05-14 21:19:13 · 153 阅读 · 0 评论 -
欧几里得辗转相除法求最大公因数
欧几里得辗转相除法求最大公因数,拓展可求最小公倍数#include <iostream>using namespace std;int Gcd(int a,int b) /*Greatest Common Divisor*/{ /*欧几里得辗转相除法*/ int m=a,n=b,rem; whil...原创 2019-05-10 11:01:57 · 320 阅读 · 0 评论