摘要: //最短路径 - Dijkstra算法 参数:图G、源点v void Dijkstra(Graph G, int v) { //初始化 int n = G.vexnum;//n为图的顶点个数 for (int i = 0; i < n; i++) { S[i] = false; D[i] = G.E 阅读全文
posted @ 2023-08-04 18:25 siuuuuuuuu 阅读(41) 评论(0) 推荐(0)
摘要: //走迷宫 #include<bits/stdc++.h> using namespace std; int front,rear,r,c,dx[4]={0,1,0,-1},dy[4]={1,0,-1,0},q[10010][3],lx,ly,mx,my; char a[110][110]; voi 阅读全文
posted @ 2023-08-03 16:29 siuuuuuuuu 阅读(32) 评论(0) 推荐(0)
摘要: //图的存储与遍历 #include<bits/stdc++.h> using namespace std; vector<int> g[11]; queue<int> f; int vis[101],visw[101]; int a[11][11]; void dfs(int x){ vis[x] 阅读全文
posted @ 2023-08-02 16:33 siuuuuuuuu 阅读(18) 评论(0) 推荐(0)
摘要: //最少点路径 #include<bits/stdc++.h> using namespace std; int n,s,t,a[11][11],xwz[11]; struct node{ int wz; string lj; }; int vis[11]; string xlj[11]; queu 阅读全文
posted @ 2023-07-23 16:03 siuuuuuuuu 阅读(44) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int dx[4]={1,-1,0,0}, dy[4]={0,0,1,-1}; int bz[100][100]={1},num=0; char s[100][100],ch; bool vis[100][10 阅读全文
posted @ 2023-07-22 17:00 siuuuuuuuu 阅读(77) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int r,s,t[200],ans; int dx[]={-1,0,1,0}, dy[]={0,-1,0,1}; char a[100][100]; void dfs(int x,int y,int cnt) 阅读全文
posted @ 2023-07-22 14:40 siuuuuuuuu 阅读(16) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int a[10][10],c=0,g[1001],s=0; void print(){ for(int i=1; i<=8; i++) cout<<g[i]; cout<<endl; } bool check 阅读全文
posted @ 2023-07-22 11:02 siuuuuuuuu 阅读(20) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; int a[1001],n; void dfs(int p,int c,int s){ if(s==n){ cout<<n<<"="<<a[0]; for(int i=1; i<c; i++) cout<<' 阅读全文
posted @ 2023-07-22 10:52 siuuuuuuuu 阅读(61) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int t,n,m,x,y; bool b[10][10]={0}; int s=0,k=0; int dx[8]={-2,-2,-1,1,2,2,1,-1}, dy[8]={1,-1,-2,-2,-1,1,2 阅读全文
posted @ 2023-07-22 10:44 siuuuuuuuu 阅读(54) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int n,a[1001][1001],f[1001][1001],s=0; int main() { cin>>n; for(int i=1; i<=n; i++) for(int j=1; j<=i; j+ 阅读全文
posted @ 2023-07-22 09:51 siuuuuuuuu 阅读(20) 评论(0) 推荐(0)