ACM-杂
文章平均质量分 54
4546love
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 1717 小数化分数
<br />http://acm.hdu.edu.cn/showproblem.php?pid=1717<br />#include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; int a,b; int gcd(int x,int y) { while(x%y) { int r=x%y; x=y; y=r; } return y; } v原创 2011-04-22 14:33:00 · 952 阅读 · 0 评论 -
poj 2773 Happy 2006
http://poj.org/problem?id=2773#include using namespace std; #define N 1001 bool h[N*N],flag[N*N]; int prime[N],cnt; void init(){ memset(h,f原创 2011-07-22 20:58:04 · 777 阅读 · 0 评论 -
杂
#include using namespace std; #define N 1000001 struct node{ double x,y; }p[N]; int n; void cal_c(){ node u,v; double area=0,tx原创 2011-07-06 14:41:02 · 462 阅读 · 0 评论 -
欧拉函数(转)
相关题目: http://acm.hdu.edu.cn/showproblem.php?pid=2824 pku 2478(与前n个数互质的个数的求和) http://acm.hdu.edu.cn/showproblem.php?pid=3508 素因子的积 http://转载 2011-07-07 15:28:53 · 784 阅读 · 0 评论 -
RMQ
#include#include#includeusing namespace std;#define MAX(x,y) (x>y?x:y)#define N 200010int num[N],n;int m;int st[20][N];int tlog2[N];void ST(){ for(int i=1;i<=n;i++) st[0][i]=num[i];原创 2011-07-03 09:01:55 · 450 阅读 · 0 评论 -
HDU 3231 Box Relations
http://acm.hdu.edu.cn/showproblem.php?pid=3231#includeusing namespace std;#define N 2001#define M 500000struct node{ int v,next; node(){}; node(int a,int b){ next=a;v=b; }}E[M];原创 2011-06-30 10:17:00 · 2042 阅读 · 0 评论 -
卡特兰数 大数
<br />#include<iostream> using namespace std; #define MAX 100 #define BASE 10000 void multiply(int a[],int Max,int b) { int i,array=0; for (i=Max-1; i>=0; i--) { array+=b*a[i]; a[i] = array%BASE; array /=原创 2011-04-26 14:09:00 · 780 阅读 · 0 评论 -
大数递推
<br />#include <iostream> using namespace std; int a[1001][100]={0}; int main(void) { a[1][99]=0;a[2][99]=a[3][99]=1; int i,j; for(i=4;i<=1000;i++) { j=99; while(j>=0) { a[i][j]+=(a[i-2][j]*2+a[i-1][j]); a[i][j-1]+=a[i][j]/1000原创 2011-04-26 14:03:00 · 643 阅读 · 0 评论 -
HDU 1568 犀利的斐波那契
<br />http://acm.hdu.edu.cn/showproblem.php?pid=1568<br />题目大意:求第N项斐波那契数列值的前四位,N很大<br />#include<iostream> #include<cmath> using namespace std; #define N 21 int f[N]={0,1}; void init() { for(int i=2;i<N;i++) f[i]=f[i-1]+f[i-2]; } void solve(in原创 2011-04-22 15:47:00 · 1455 阅读 · 0 评论 -
HDU 3902 Swordsman
http://acm.hdu.edu.cn/showproblem.php?pid=3902 额外加上每两个点的中点,把N个点扩展成2*N个,然后枚举1到n点,于其对面的点相连,当作对称轴,然后看这条线段两边成对的点的连线,是否于对称轴平分且垂直,不要忘了还要平分这个条件 #原创 2011-08-03 12:00:30 · 1206 阅读 · 0 评论
分享