X-man

导航

上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 59 下一页

2013年5月1日 #

十进制转换为二进制

摘要: #include<stdio.h>#include<fstream>#include<iostream>using namespace std;int main(){ ifstream cin("B.txt"); int n; char a[100]; //while(scanf("%d",&n)!=EOF) while(cin>>n&&n>=0) { int m=n; int js=0; for(int i=0; m; i++) { if(m&1)a[i]=' 阅读全文

posted @ 2013-05-01 15:38 雨钝风轻 阅读(218) 评论(0) 推荐(0) 编辑

Problem 1462 - Books changing(模拟题STL数据结构)

摘要: http://acm.whu.edu.cn/land/problem/detail?problem_id=1462#include<stdio.h>#include<list>#include<deque>//TLE//#incldue<fstream>#include<iostream>using namespace std;//list<int>la,lb,lc;//list<int>::reverse_iterator rit;//list<int>::iterator it;deque< 阅读全文

posted @ 2013-05-01 13:26 雨钝风轻 阅读(227) 评论(0) 推荐(0) 编辑

2013年4月30日 #

硬币水题II

摘要: #include<stdio.h>int main(){ int _case; double p; scanf("%d",&_case); while(_case--) { scanf("%lf",&p); printf("%.2lf\n",1/p/(1-p)); } return 0;}http://www.bnuoj.com/bnuoj/problem_show.php?pid=29064 阅读全文

posted @ 2013-04-30 21:23 雨钝风轻 阅读(178) 评论(2) 推荐(0) 编辑

沙漠之旅

摘要: #include<stdio.h>#include<algorithm>#include<iostream>using namespace std;int a[1005];int main(){ int _case,l,x,n; int i,j,k,g; scanf("%d",&_case); while(_case--) { scanf("%d %d %d",&l,&x,&n); for(i=0;i<n;i++) scanf("%d",&a[i]); 阅读全文

posted @ 2013-04-30 21:11 雨钝风轻 阅读(214) 评论(2) 推荐(0) 编辑

DP汇总

摘要: 1.1010. Whack the Groundhog http://soj.me/show_problem.php?pid=1010&cid=1004 题解:http://www.cnblogs.com/A-way/2.团队建设 http://www.bnuoj.com/bnuoj/contest_show.php?cid=1605#problem/179593.Taiko taiko http://www.bnuoj.com/bnuoj/contest_show.php?cid=1605#problem/17960 阅读全文

posted @ 2013-04-30 19:52 雨钝风轻 阅读(181) 评论(0) 推荐(0) 编辑

sicily 8058. Matrix

摘要: #include<stdio.h>int a[1005][1005];int main(){ int n,m,q,_case; char c; int x,x1,x2,y1,y2,t; int ii,i,j; scanf("%d",&_case); while(_case--) { scanf("%d %d %d",&n,&m,&q); for(i=0;i<n;i++) for(j=0;j<m;j++) scanf("%d",&a[i][j]); for(i=0;i< 阅读全文

posted @ 2013-04-30 19:44 雨钝风轻 阅读(141) 评论(0) 推荐(0) 编辑

sicily 1001. Black Magic

摘要: #include<stdio.h>#include<string.h>int main(){ int _case; int n,m,k; scanf("%d",&_case); while(_case--) { scanf("%d %d %d",&n,&m,&k); int t,sum=0; //k=p; for(t=n;t>=0;t-=m) { sum+=t; if(k-sum<=0)break; } //printf("... 阅读全文

posted @ 2013-04-30 19:39 雨钝风轻 阅读(128) 评论(0) 推荐(0) 编辑

L. 斩

摘要: http://www.bnuoj.com/bnuoj/contest_show.php?cid=1605#problem/17966#include<stdio.h>#include<math.h>int main(){ int _case; int x1,x2,y1,y2,a,b,c; double x,xp,xm,xn,ym,yp,yn; double su; scanf("%d",&_case); while(_case--) { scanf("%d %d %d %d %d %d %d",&x1,&y 阅读全文

posted @ 2013-04-30 19:32 雨钝风轻 阅读(327) 评论(0) 推荐(0) 编辑

2013年4月29日 #

hdu 2161(Primes)

摘要: 打表求素数:#include<stdio.h>int a[16005];int isprime(){ for(int i=0;i<16005;i++) a[i]=i; a[1]=0; for(int i=2;i<=16005;i++) { if(a[i]!=0) for(int j=2;i*j<=16005;j++) a[i*j]=0; } a[2]=0; return 0;}int main(){ int n; isprime(); int i=0; while(scanf("%... 阅读全文

posted @ 2013-04-29 16:02 雨钝风轻 阅读(164) 评论(0) 推荐(0) 编辑

2013年4月27日 #

hdu 1395(2^x mod n = 1)

摘要: 分析: 1、n==1或者n%2==0,都不会有这样的2的幂次存在。 因为2^k(k=1、2、3...)为偶数,n为偶数时显然不存在;n==1则容易验证。 2、n为奇数是则一定存在。 n为奇数,则至少会存在一个偶数模取n等于1。2^k则会找到所有的偶数。#include<stdio.h>int main(){ int n,x; int i; while(scanf("%d",&n)!=EOF) { if(n==1||n%2==0)printf("2^? mod %d = 1\n",n); else { ... 阅读全文

posted @ 2013-04-27 23:04 雨钝风轻 阅读(149) 评论(0) 推荐(0) 编辑

上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 59 下一页