摘要:
#include <iostream> #include <vector> #include <cstring> using namespace std; const int N=1e5+5; int h[N], e[N], ne[N], indegree[N], idx; int head, ta
閱讀全文
摘要:
#include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 100010, M = 200010, INF = 0x3f3f3f3f; int n, m; int p[N];
閱讀全文
摘要:
m進制轉十進制 #include<cstdio> #include<iostream> #include<cstdlib> #include<cstring> char a[10000]; using namespace std; int main() { int n,m; int f=0; sca
閱讀全文
摘要:
#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N=510; int g[N][N]; //為稠密陣所以用鄰接矩陣存儲 int dist[N]; //用于記錄每一個點距離第
閱讀全文
摘要:
//對于基礎類型 默認是大頂堆 (降序)priority_queue<int> a;//升序隊列 priority_queue <int,vector<int>,greater<int> > q; //降序隊列 priority_queue <int,vector<int>,less<int> >q
閱讀全文
摘要:
int dfs(int v){ vis[v] = -1; for(int i = 1; i <= n; i++) { if(a[v][i] != 0 && !vis[i]) { dfs(i); vis[i]=1; } if(a[v][i] != 0 && vis[i] == -1){ printf(
閱讀全文
摘要:
#include<iostream> #include<cstring> using namespace std; const int maxn=50010; int head[maxn],cnt; int dfn[maxn],low[maxn],tot,stack[maxn],idx,visit[
閱讀全文
摘要:
#include<bits/stdc++.h> using namespace std; const int maxn = 1005;//點數最大值 int n, m, cnt;//n個點,m條邊 struct Edge { int to, w, next;//終點,邊權,同起點的上一條邊的編號 }
閱讀全文
摘要:
#include <math.h> double ceil( double num ); double floor( double arg ); ceil函數返回不小于num的最小整數,如num = 6.04, 則返回7.0 floor函數返回不大于num的最大的數,如num = 6.04, 則返回
閱讀全文