Skip to content

Instantly share code, notes, and snippets.

View asdfgh0308's full-sized avatar

Necs asdfgh0308

View GitHub Profile
@asdfgh0308
asdfgh0308 / gist:3912674
Created October 18, 2012 15:45
poj1845
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define NN 11000
#define int long long
int tp,prime[NN],pre[NN],x,y,d;
const int mod=9901;
@asdfgh0308
asdfgh0308 / gist:3899120
Created October 16, 2012 12:59
zoj3665长春K
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
typedef long long LL;
LL n,r,k;
LL ansk,ansr,Max;
@asdfgh0308
asdfgh0308 / gist:3899115
Created October 16, 2012 12:58
zoj3664长春J
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define NN 2100
int xl,yl,xr,yr,root,totnode,n,q,i,pos,dep,tmp1,tmp2,ans,son[NN];
struct node{
int l,r;
@asdfgh0308
asdfgh0308 / gist:3899106
Created October 16, 2012 12:57
zoj3662长春H
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int n,m,k,totpri,totfac,f[2][40][1010];
int pas,now,i,j,r,l,tp,newsta;
int svpri[10],mulpri[10],fac[100],svsta[100];
@asdfgh0308
asdfgh0308 / gist:3899095
Created October 16, 2012 12:54
zoj3659长春E
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
#define NN 201000
struct Edge{int a,b,c;}edge[NN];
@asdfgh0308
asdfgh0308 / gist:3899074
Created October 16, 2012 12:50
zoj3656长春B
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define NN 1110
#define MM 11100000
int n,i,j,b[NN][NN],flag,bit;
int first[NN],next[MM],v[MM],tote;
@asdfgh0308
asdfgh0308 / 主席树
Created October 16, 2012 12:26
主席树
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define NN 101000
int n,m,i,ord[NN],b[NN],totn,tott,root[NN],a,bb,c;
struct segtree{