摘要:
#include #define MAXN 200 using namespace std; int C[MAXN][MAXN]; int F[MAXN][MAXN]; int P[MAXN]; int M[MAXN]; int N, S, T; void dfs(int u) { for (int i = 0; i F[u][i]) { P... 阅读全文
摘要:
#include #define MAXN 15000 #define MAX 32002 using namespace std; int STAR[MAX] = {0}; int LEV[MAXN] = {0}; int lowbit(int n) { return n & (-n); } int sum(int n) { int r = 0; whi... 阅读全文
摘要:
#include using namespace std; int M[3] = {23, 28, 33}, A[3], NOW; int exGCD(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int r = e... 阅读全文
摘要:
#include #include #include #define VMAX 600 #define PMAX 800 using namespace std; map item; map::iterator it; int n, n2, m, k; int match; int map1[PMAX][PMAX] = {0}; //关联图 int map2[VMAX][VMAX] ... 阅读全文
摘要:
#include #define MAXN 1102 using namespace std; int C[MAXN][MAXN]; int F[MAXN][MAXN]; int P[MAXN]; int M[MAXN]; int PIG, REN; int S, T; void dfs(int u) { for (int i = 0; i F[u][i]) { ... 阅读全文
摘要:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*扩展欧几里德求模线性方程感谢logic_space的指正*/#include#defineabs(a)((a)<0?-(a):(a))usingnamespacestd;__int64exGCD(__int64a,__int64b,__int64&x,__int64&y){if(b==0){x=1;y=0;returna;}__int64r=exGCD(b,a%b,x, 阅读全文
摘要:
#include #define MAXN 100001using namespace std;int OP[MAXN][3];int JUMP[MAXN];int COLOR[MAXN];int main(){ int cas, ans, n, q, temp; int i, j, k; scanf("%d", &cas); for (j = 1; j = 0; ... 阅读全文
摘要:
#include using namespace std; struct type1 { int parent; int rank; } FOOD[50001]; int find(int i) { int t = FOOD[i].parent; if (t n || y > n) lie++; else if (d... 阅读全文