`
Dustman
  • 浏览: 13650 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
文章列表
一共三个文件 实现得很恶心,很多代码没效率 SCR.c #include "SCR.h" typedef enum mode_t { CHARACTER = 3, BACKGROUND = 4 } mode_t; static struct termios orig; static unsigned int term_init = 0; void clear(void) { fprintf(stderr, "\033[2J"); } int start_iaction(int sec, int ...
就是求所有顶点对的最短路径长度 #include <iostream> #include <vector> using namespace std; typedef struct{ int vexs[10]; int edges[10][10]; int n; int e; }MGraph; #define INFINITE 2048 void CreateGraphM(MGraph *G){ int N1,N2; cout<<"Enter the number of ...
三种最短路径算法 Dijkstra: #include <iostream> #include <queue> #include <vector> using namespace std; typedef struct{ int vexs[10]; int edges[10][10]; int n; int e; }MGraph; #define INFINITE 2048 void CreateGraphM(MGraph *G){ int N1,N2; int i,j,k; ...
#include <iostream> #include <vector> #include <algorithm> using namespace std; typedef struct{ int vexs[10]; int edges[10][10]; int n; int e; }MGraph; #define INFINITE 2048 void CreateGraphM(MGraph *G){ int N1,N2; int i,j,k; cout<<& ...
#include <iostream> #include <vector> using namespace std; #define EXCHANGE(a,b) \ ({typeof(a) _tmp; \ _tmp=a; \ a=b; \ b=_tmp;}) ...
//有向图判断是否有环 #include <iostream> #include <list> #include <vector> #include <algorithm> using namespace std; #define TRUE 1 #define FALSE 0 typedef struct{ int vexs[10]; int edges[10][10]; int n; int e; }MGraph; void CreateGraphM(MGraph *G){ ...
#include <iostream> //有向图的强连通分量 //翻转边集 深度优先遍历 using namespace std; typedef struct{ int vexs[10]; int edges[10][10]; int n; int e; }MGraph; void CreateGraphM(MGraph *G){ int N1,N2; int i,j,k; printf("Enter the number of vertexs and edges: \n"); ...
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; #define EXCHANGE(a,b) \ ({typeof(a) _tmp; \ _tmp=a; \ a=b; ...
#include <iostream> #include <set> using namespace std; #include "IO.hpp" void SIEVE(set<int>& primes,int limit){ int index; primes.erase(primes.begin(),primes.end()); for(int i=2;i<limit;i++) primes.insert(i); for(int i=2;i*i& ...
#include <iostream> #include <vector> #include <math.h> #include <time.h> #include <algorithm> using namespace std; unsigned long long MOD_EXP(unsigned long long A,\ unsigned long long B,\ unsigned lon ...
Global site tag (gtag.js) - Google Analytics