Java之路
文章平均质量分 53
huixisheng
无所谓结果如何,只要一直坚持并努力就好!!
展开
-
hdu 1016 Prime Ring Problem
<br />import java.io.*;import java.util.*;public class Main{ static boolean [] hash = new boolean [45]; static boolean [] flag = new boolean [23]; static int [] num = new int[23]; static PrintWriter cout = new PrintWriter(new OutputStreamWrit原创 2010-07-23 17:08:00 · 433 阅读 · 0 评论 -
hdu 1728 逃离迷宫 java BFS + 一搜到底
<br />/* 刚开始学习java 代码写起来总是很搓的 */import java.io.*;import java.util.*;class Node { int x, y, pre, count; Node(int x, int y, int pre, int count) { this.x = x; this.y = y; this.pre = pre; this.count = count; }}public class原创 2010-07-26 12:37:00 · 764 阅读 · 0 评论 -
hdu 1175 连连看 java (BFS + 一搜到底)
<br /> <br />import java.io.*;import java.util.*;class Node{ int x, y, pre, num; Node(int x, int y, int pre, int num) { this.x = x; this.y = y; this.pre = pre; this.num = num; }}public class Main1175{ static int dir[][] =原创 2010-07-26 12:34:00 · 540 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=1108 java BIgInteger gcd
<br />import java.util.*;import java.io.*;import java.math.*;public class Main1108 { public static void main(String[] args){ int a, b; Scanner cin = new Scanner(new BufferedInputStream(System.in)); while( cin.hasNext()){ a = cin.nextIn原创 2010-08-08 19:40:00 · 777 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=2446
<br />/* * 很水的一个题目,为何给我弄得最后才AC * 自责ing * 1 + 1 + 2 + 1 + 2 + 3 + .... = n(n + 1)(n + 2) / 6; * 二分找最小的n 满足n(n + 1)(n + 2) / 6 >= yy * 在二分找r(r + 1)/2 <= xx * 在最大r * 原来是long 相乘的时候益处了,一直以为是自己的代码写错了 * zhc说的对,用了BigInteger 干嘛要用long * 好原创 2010-09-16 20:04:00 · 696 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=2441 犀利的证明
<br />/*令F(1)=1,F(N)=∑F(d)%2 (d|N 且d!=N)F(N)=1,则N在数组里。(除了1以外)1.对于N=P^a F(P)=F(1)=1,F(P*P)=F(1)+F(P)=0,F(P^a)=F(1)+F(P)+……F(P^(a-1))=F(1)+F(P)=0;2.对于N=P^a Q^b a=1时 b=1 F(N)=F(1)+F(P)+F(Q)=1 b=2 F(N)=F(1)+F(P)+F(Q)+F(P×Q)=原创 2010-09-18 18:50:00 · 618 阅读 · 0 评论 -
http://acm.pku.edu.cn/JudgeOnline/problem?id=1131 八进小数转十进制小数
<br />import java.io.*;import java.util.*;import java.math.*;public class Main { static Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in))); public static void main(String[] args){ String tep; BigDecimal one = Bi原创 2010-09-18 21:29:00 · 670 阅读 · 0 评论 -
http://acm.pku.edu.cn/JudgeOnline/problem?id=2305 大数的b进制数 取模
<br />import java.io.*;import java.util.*;import java.math.*;public class Mainpku2305 { static Scanner in=new Scanner(new BufferedReader(new InputStreamReader(System.in))); public static void main(String[] args){ int b; while(in.hasNext()){原创 2010-09-18 22:26:00 · 995 阅读 · 0 评论