自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 收藏
  • 关注

原创 天气情况

#include #include #include using namespace std;struct M{ int n; double m[3][3]; M(int nn=3) { n = nn; for(int i=0;i<3;i++) for(int j=0;j<3;j++) m[i][j]=0.0L; }};M orignal;

2012-03-31 13:24:45 418

原创 Matrix Power Series

#include #include using namespace std;struct M{ int n; int m[30][30]; M(){ for(int i=0;i<30;i++) for(int j=0;j<30;j++) m[i][j]=0; }};int mod;M orginal;M mul(M a,M

2012-03-31 12:52:12 262

原创 Fibonacci n<10^10次方它的后四位

#include #include using namespace std;struct M{ int m[4][4];};M mul(M a,M b){ M c; c.m[0][0]=(a.m[0][0]*b.m[0][0]+a.m[0][1]*b.m[1][0])%10000; c.m[0][1]=(a.m[0][0]*b.m[0][1]+a.m[0

2012-03-31 12:19:34 1263

原创 hdu 1175 其实真的可以不用搜索!!

#include #include using namespace std;int n,m,p;int map[1002][1002];int dist[4][2]={{0,1},{0,-1},{1,0},{-1,0}};int narrow[1002][1002];bool solve(int x,int y,int xx,int yy){ if(map[xx][yy]!

2012-03-31 00:55:29 338

原创 poj 1023

import java.util.*;import java.math.*;public class Main{ public static String solve(String s, long n) { // if(n==Long.MIN_VALUE)return "10000000000000000000000000000000000000000

2012-03-27 19:21:10 470

原创 An Easy Problem!

Have you heard the fact "The base of every normal number system is 10" ? Of course, I am not talking about number systems like Stern Brockot Number System. This problem has nothing to do with this fac

2012-03-27 16:43:46 356

原创 poj 1730 map 水过

#include #include #include #include using namespace std;typedef __int64 LL;const LL M = 2147483649;map G;LL pows(LL a,LL b){ LL result = 1; while(b--) { result *= a; } return res

2012-03-27 16:03:17 299

原创 poj 1730 java+数学方法

import java.util.*;import java.math.*;public class Main{ static int prime[]= new int[100000]; static boolean isprime[]=new boolean[1000001]; public static void creatprime() { A

2012-03-27 16:01:30 306

原创 不要62 //java字符串功能强大呀

import java.util.*;import java.math.*;public class Main{ public static int arr[] = new int[1000001]; public static void init() { arr[1]= 1; for(int i=2;i<1000001;i++) { String s = Inte

2012-03-25 17:49:02 581

原创 my ability is poor!

#include #include #include using namespace std;#define M 10000int prime[M];bool is[M];int factor[20];struct E{ int a,b; E(int a=0,int b=0){this->a=a;this->b=b;};};void creatprime(){

2012-03-23 20:08:21 309

原创 一个超时的题,本是想用Java学调试的,写辛苦了,所以抄下来

Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relatively prime to 2006. Now your job is easy

2012-03-23 19:26:16 426

原创 hdu 2444

#include #include #include using namespace std;int map[202][202];int link[202];int vis[202];int n,m;bool flag;int c[202];void check(int i,int m){ if(flag)return; for(int j=1;j<=n;j+

2012-03-20 19:32:17 333

原创 1083

#include using namespace std;int map[102][303];int vis[303];int link[102];bool issearch(int k){ for(int i=1;i<=map[k][0];i++) { if(!vis[map[k][i]]){ vis[map[k][i]] = 1; if(!link[map[

2012-03-20 17:42:00 291

原创 N! java

import java.util.*;import java.math.*;public class Main{ public static void main(String[]args) { Scanner in = new Scanner(System.in); int one; BigInteger temp = BigInteger.ONE; while(in.

2012-03-20 14:54:59 286

原创 hdu 4004 二分法

#include #include #include #include #include using namespace std;//typedef __int64 LL;int a[500005];bool is(double x,int n,int m){ int count=0; int sum=0; for(int i=0;i<=n;i++) {

2012-03-20 14:49:42 485

原创 hdu 1011 树dp还是容易理解的,不过在做这个题的时候把一个边界条件给忽略了,以后得注意

#include #include #include #include using namespace std;struct Node{ int a,b;};Node edge[210];vector nextpoint[105];int dp[105][105];int n,m;inline int maxx(int a,int b){ return a>b?

2012-03-16 14:27:25 355

原创 hdu 1077 意思懂,没思路,借用大牛的思想

大牛的这么认为,给定两个点,如里它们的距离大于直径,不必考虑,否则,认为这两个点在某一圆上,计算出圆心坐标,依次遍历顶点,记录在这个圆里面的点,这个值就是我们要进行判定的值。。。#include #include #include using namespace std;const static double eps = 1e-6;struct Point{ do

2012-03-15 21:05:07 1466 1

原创 hdu 1035很简单的一个模拟

#include #include #include using namespace std;char map[1000][1000];int mapss[1000][1000];int n,m,k;int x,y,xx,yy;void init(){ while(scanf("%d%d",&n,&m)!=EOF) { if(n==0&&m==0)break;

2012-03-15 19:57:38 420

原创 hdu 1027 不解释,好多方法,鄙人最近常做搜索,它就做个试验吧!

#include #include //hdu 1027using namespace std;int a[1001];//填充数组int n,m;bool isa[1001];//标记数组int nn[9]={0,1,2,6,24,120,720,5040,40320};//1-9的阶乘bool search(int i)//填第i个数的搜索式算法,返回bool类型是想加速

2012-03-15 18:58:10 694

原创 poj 3349 原来用C++STL写的,怎么也过不了,后面还是自己写Node

#include #include #include #include using namespace std;const static int prime = 99991;struct Node{ int a[6]; struct Node * next;};Node map[100005];Node mapss[100005];void init(){fo

2012-03-15 16:39:59 490

原创 hdu 1026 从目标位置宽度搜索不会超栈,顺着我写的会,不过没去做优化

#include #include #include #include using namespace std;struct P{ int x,y,howst,time; P(){x=0,y=0,howst =0;time =0;} P(int a,int b,int c=0,int n=0){x =a;y = b; howst = c;time =0;}};queue

2012-03-14 17:02:23 436

原创 hdu 1372 本来开了个无用的数组,结果无数次ML

#include #include #include #include #include using namespace std;int dist[8][2] = {{2,1},{2,-1},{-2,1},{-2,-1},{1,2},{1,-2},{-1,2},{-1,-2}};int x,y,xx,yy;int a,b;struct P{ int a,b,len;}

2012-03-14 14:45:26 332

原创 hdu 1728

#include #include #include #include #include using namespace std;struct P{ int i,j; P(int ii,int jj){i =ii;j=jj;}};char map[105][105];int n,m;int to;int dist[4][2]={{0,1},{0,-1},{1,0}

2012-03-14 13:02:03 416

原创 hdu 1312

#include #include #include #include #include #include using namespace std;char map[30][30];bool flag[30][30];int n,m;int dist[4][2]={{0,1},{0,-1},{1,0},{-1,0}};bool is(int x,int y){

2012-03-13 20:40:57 335

原创 hdu 2603见鬼了,这久才过

#include #include #include #define GRAVITY 9.87f#define PI 3.1415926int main(){ double v,m,a,t1,t2,distance,v1; double solution(double a,double b,double c); while(scanf("%lf%lf%lf",&v,&m,&a

2012-03-13 18:49:07 582

原创 hdu 2554

#include #include #include #include using namespace std;//char s[1000];//搜索试探性找规律,经实验只能算到n<=8//bool ss[1000];//bool flag;////bool is(int n)//{// for(int i=1;i<=n;i++)if(!ss[i])return 0;/

2012-03-13 17:02:22 985 3

原创 hdu 2552

#include #include #include using namespace std;const static double PI = acos(-1.0);const static double G = 9.8;int main(){ int test; cin>>test; while(test--) { double x,y; scanf("%l

2012-03-13 16:08:48 403

原创 hdu 2548

#include #include #include using namespace std;const static double PI = acos(-1.0);const static double G = 9.8;double dist(double x,double y,double xx,double yy){ return yy/(x+y)*xx;}int

2012-03-13 16:01:56 428

原创 hdu 2547

#include #include #include using namespace std;const static double PI = acos(-1.0);const static double G = 9.8;double dist(double x,double y,double xx,double yy){ return sqrt((x-xx)*(x-xx)+(

2012-03-13 15:56:43 469

原创 hdu 2529

#include #include #include using namespace std;const static double PI = acos(-1.0);const static double G = 9.8;double heigth(double l,double v,double h){ return v*v/2.0/G - G*l*l/2.0/v/v+h;

2012-03-13 15:50:45 300

原创 hdu 2438 暴力吧

#include #include #include using namespace std;bool distances(double x,double y,double l,double w){ double angle = atan2(y,x); for(double i=0.0;i<=angle;i+=0.0001) { double temp =

2012-03-13 15:14:14 819 1

原创 hdu 2393

#include #include #include using namespace std;typedef __int64 LL;bool solve(LL a,LL b,LL c){ if(a*a+b*b==c*c||a*a+c*c==b*b||c*c+b*b==a*a)return 1; else return 0;}int main(){ int tes

2012-03-13 14:13:14 372

原创 hdu 2303 它大爷的用java过不了,才用c++

#include #include #include using namespace std;int prime[100000];bool isprime[1000005]={0};int l=1;void creatprime()//创建一个素数表{ int i,j; prime[0]= 2; for(i=4;i<1000005;i+=2) isprime[i]

2012-03-13 13:59:00 532

原创 hdu 2134 水呀

#include #include #include using namespace std;const static double PI = acos(-1.0);void solve(double r,double &r1,double &r2){ r1 =r/sqrt(3.0); r2 = r/sqrt(1.5);}int main(){ double radi

2012-03-13 11:12:30 500

原创 hdu 1999 不可摸数

#include #include #include using namespace std;int a[1005];int b[1000005];void not_toch(){ memset(a,0,sizeof(a)); for(int i=0;i<1000005; i++)b[i] = 1; for(int i=2;i<=500005;i++) { for

2012-03-13 11:02:18 439

原创 http://acm.fafu.edu.cn/showproblem?problem_id=1005食物链 (第一次用类写,居然过了

#include #include #include #include #include #include using namespace std;class arc{ string code; int i;public: arc(){code="";i=-1;} arc(string a,int b){code=a;i=b;} string getcode()

2012-03-13 10:18:29 1636

原创 hdu 1798 两圆相交

#include #include #include //hdu 1798 两圆相交的面积using namespace std;const static double PI = acos(-1.0);inline double area(double r)//返回圆的面积{ return PI*r*r;}inline double maxx(double x,double

2012-03-13 10:12:03 502

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除