摘要:
#include#include#define N 2100int degree[N];int pre[N];//很长时间没写欧拉回路了忘了判断他是否联通了int find(int x) {if(x!=pre[x]) pre[x]=find(pre[x]);return pre[x];}int... 阅读全文
摘要:
#include#include#define inf 0x3fffffff#define N 600struct node {int x,y,w;}ma[N*N];int cmp(const void *a,const void *b) {return (*(struct node *)a).w... 阅读全文
摘要:
#include#include#define N 110000struct node {int u,v,next;}bian[N*2];int head[N],yong,pre[N];void addedge(int u,int v) {bian[yong].u=u;bian[yong].v=v;... 阅读全文
摘要:
/*******************************/ /******Writer: GJ *******/ /******Language: C *******/ /******Date: 2013 3 23 *******/ /*****... 阅读全文
摘要:
#include#include#include#includeusing namespace std;int main() { int n,m,i,j,k,t; char s[30]; scanf("%d",&t); while(t--) { scanf("%d%s",&n,s); if(st... 阅读全文
摘要:
#include#include#define ll __int64#define N 11000struct node {int start,end;}ma[N];int main() { ll n,m,i,j,k,t; while(scanf("%I64d%I64d",&n,&m),n||m) ... 阅读全文
摘要:
#include#include#include#include#define N 700#define NN 2000010int prime[NN];int a[N];struct node {int x,y,w;}ma[N*N];void ispri() { int i,j; memset(p... 阅读全文
摘要:
别人的代码开始自己不知道什么数论解法: ab*ab=(a*10+b)(a*10+b)=a^2*100+2ab*10+b^2 所以the root digital=(a+b)*(a+b); 而数论中的定理:两数之积对9取余数等于两数对9的余数的乘积。 ... 阅读全文