摘要: #include#includeint prime[1100000],p[1000000],ans;void pri() { int i,j,k; memset(prime,-1,sizeof(prime));prime[0]=prime[1]=0; for(i=2;i=x&&prime[p[i]-... 阅读全文
posted @ 2013-09-09 17:34 HYDhyd 阅读(87) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/shahdza/article/details/6586430还在因为 怕 g++ 提交时间很慢,但是用C++ 交又怕栈溢出???我们都知道,如果代码里有 递归函数 频繁调用, 用 C++ 提交代码, 很可能就会 出现 Runtime Error ... 阅读全文
posted @ 2013-09-09 17:15 HYDhyd 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include#include__int64 min(__int64 a,__int64 b) { return an) cmp=n-now; ans+=cmp*abs(x-y); x=(x+cmp)%a; y=(y+cmp)%... 阅读全文
posted @ 2013-09-09 16:53 HYDhyd 阅读(101) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 100000struct st{int x,y,yanchi;}a[N*4];void build(int t,int x,int y) {a[t].x=x;a[t].y=y;a[t].yanchi=1;if(x==y) return ;int t... 阅读全文
posted @ 2013-09-03 20:06 HYDhyd 阅读(105) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 100000struct st{int x,y;__int64 yanchi,sum;}a[N*4];__int64 b[N];void build(int t,int x,int y) {a[t].x=x;a[t].y=y;a[t].yanchi... 阅读全文
posted @ 2013-09-03 18:49 HYDhyd 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include#includeint max(int a,int b ) {return a>b?a:b;}int a[8];int dp[50000];int main() { int i,j,m=0,sum,k,l; while(scanf("%d%d%d%d%d%d",&a[1],&a[2]... 阅读全文
posted @ 2013-08-20 10:13 HYDhyd 阅读(121) 评论(0) 推荐(0) 编辑
摘要: #includeint main() {__int64 i,n,c,t,l,vr,vt1,vt2,p[101];double f[101];while(scanf("%I64d%I64d%I64d%I64d%I64d%I64d%I64d",&l,&n,&c,&t,&vr,&vt1,&vt2)!=EO... 阅读全文
posted @ 2013-08-19 15:22 HYDhyd 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include#includeint main() {int i,j,t,k,count,a[6010],n,sum;scanf("%d",&t);while(t--) {scanf("%d",&n);memset(a,0,sizeof(a));sum=0;k=2;while(sum<n-3) {... 阅读全文
posted @ 2013-08-19 10:13 HYDhyd 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Intersecting LinesTime Limit:1000MS Memory Limit:65536KTotal Submit:13 Accepted:4DescriptionWe all know that a pair of distinct points on a plane defi... 阅读全文
posted @ 2013-08-17 20:02 HYDhyd 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #includeint main() {int n;while(scanf("%d",&n),n) {n=n*n-1;if(n%2)printf("8600\n");elseprintf("ailyanlu\n");}return 0;} 阅读全文
posted @ 2013-08-16 10:36 HYDhyd 阅读(125) 评论(0) 推荐(0) 编辑