09 2015 档案
摘要:#include#include#include#include#includeusing namespace std;const int inf=0x7fffffff;const int N=10000+5;int p,t,f1[N],f2[N],dis1[N],dis2[N];s...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;const int inf=0xfffffff;const int M=1000000+5;struct Edge{ int u,v,w;} edge[M];int n,m,dis...
阅读全文
摘要:#includeusing namespace std;const int N= 200000+5;int a[N],ans;struct Tree{ int left,right; int sum;}tree[4*N+10];void build(int id,int ...
阅读全文
摘要:#includeusing namespace std;const int N=5000+5;int a[N];struct Tree{ int left,right,sum;}tree[4*N+10];void build(int id,int l,int r){ tr...
阅读全文
摘要:#includeusing namespace std;typedef int ll;const int N=200000+5;int a[N],ans;struct Tree{ int left,right; ll maxv;}tree[4*N+10];//建立线段树,...
阅读全文
摘要:#include#include#includeusing namespace std;struct node{ int x,y; int h;}b[510*510];int cmp(node n1,node n2){ return n1.h<n2.h;}int m...
阅读全文
摘要:递归#include#include#includeusing namespace std;int n,d[124][124],ans[124][124];int maxans(int i,int j){ if(ans[i][j]!=-1) return ans[...
阅读全文
摘要:#includeusing namespace std;int cmp(int a,int b){ return a>b;}int flag,t,n,a[20],use[20];void dfs(int sum,int now){ int i; if(sum==t)...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;int dp[1<<14];int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include //#includeusing namespace...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;int g[60][60],in[100],n,m;void dfs(int t){ int i; for(i=1; iusing namespace std;typedef...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;struct data{ int x,c,t;}b[10000+5];int cmp(data n1,data n2){ return n1.xl) printf("Fell...
阅读全文
摘要:#includeusing namespace std;long long x1,t,ans,m,c[1000000+5];int main(){ int i,n; while(~scanf("%d",&n)) { m=0; c[0]=...
阅读全文
摘要:import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String[] args) { // TODO Auto-gener...
阅读全文
摘要:import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String[] args) { // TODO Auto-gener...
阅读全文
摘要:#includeusing namespace std;const int N=150000+5;struct node{ int v,id; char s[200+5]; friend bool operator n2.id; return n1.v...
阅读全文
摘要:#includeusing namespace std;int main(){ int _,i,n,a[1024],m,r,l,ans; scanf("%d",&_); while(_--) { scanf("%d",&n); fo...
阅读全文
摘要:#includeusing namespace std;const int N=10000+5;typedef long long ll;struct Edge{ int u,v,use;};vectoredge;vectorg[N];int n,m,a[N],in[N],cn...
阅读全文
摘要:根据规则可以看出来就是n的卡特兰数乘二import java.math.BigInteger;import java.util.Scanner;public class Main{ public static void main(String[] args) { ...
阅读全文
摘要:import java.math.BigInteger;import java.util.Scanner;public class Main { /** * @param args */ public static void main(String[] a...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;int n,m;ll dp[25][25];int main(){ int i,j; memset(dp,0,sizeof(dp)); dp[1][1]=1; f...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include //#includeusing namespace...
阅读全文
摘要:方法一#include #include #include #include #include #include #include #include #include #include #include #include #include //#includeusing namesp...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include //#includeusing namespace...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;int main(){ int _,n,i; ll a[40]; a[0]=1; for(i=1;i<30;i++) { a[i]=3*a[i...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typed...
阅读全文
摘要:#includeusing namespace std;typedef long long ll;int main(){ ll a[25],b[25]; int i,n,_; b[1]=1; for(i=2;i<=20;i++) b[i]=b[i...
阅读全文
摘要:#include#include using namespace std;typedef long long ll;int main(){ ll a[70],t; int i,j,n; a[1]=1; a[2]=3; a[3]=5; for(i=4...
阅读全文
摘要:#includeusing namespace std;int d[500000+5],a[500000+5];int Binary_search(int s,int t,int i){ int mid; while(s>1; if(i>=d[mid]) s...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typed...
阅读全文
摘要:#includeusing namespace std;struct Edge{ int from,to,tag,id;};int n,m,dfn[100000+5],low[100000+5],vis[100000+5],dep,b[100000+5],num=0;vecto...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;const...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;const...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;int n...
阅读全文
摘要:A 统计字符 (15分)#includeusing namespace std;int main(){ int i,a,b,c,d; char s; a=0;b=0;c=0;d=0; for(i=0;i='A') a++; else if(s...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;int n...
阅读全文
摘要:#includeusing namespace std;const int inf=0x7fffffff;int n,m,g[1024][1024],dist[1024];void prim(){ int ans,i,j,v,minx; for(i=0; i<n; i++...
阅读全文
摘要:#includeusing namespace std;long long inf=1e18;mapm;long long a[1200000],h;int main(){ int n,_,p,cnt; m.clear(); memset(a,0,sizeof(a)...
阅读全文
摘要:找到一条直线,与全部线段都相交。直线由线段中的两个端点组成,所以枚举一下就好了。#includeusing namespace std;const double eps=1e-8;struct point{ double x,y;} a[1024];double cross(p...
阅读全文
摘要:#includeusing namespace std;int main(){ int n,m,u,v,w,i,j,k,t,num,ans,g[128][128]; while(~scanf("%d%d",&n,&m)) { for(i=1; in&&...
阅读全文
摘要:#includeusing namespace std;int n,a[10000+5];int main(){ int i,ans,t,tl,tr,l,r; while(~scanf("%d",&n)) { memset(a,0,sizeof(a))...
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;int n...
阅读全文
摘要:#includeusing namespace std;int n,a[100000+5];int maxsum(int x,int y){ int m,L,R,v,i,maxs; if(y-x==1) return a[x]; m=x+(y-x)/2; ma...
阅读全文