摘要:
题目大意:关于大数的加法和除法的,用Java的BigInteger可以方便地解决。 1 import java.io.*; 2 import java.util.*; 3 import java.math.*; 4 5 class Main 6 { 7 public static void main(String[] args) 8 { 9 Scanner sc = new Scanner(System.in);10 int kase = 0;11 while (true)12 {13 ... 阅读全文
posted @ 2013-09-14 22:06
xiaobaibuhei
阅读(371)
评论(0)
推荐(0)
摘要:
今天有Google of Greater China Test for New Grads of 2014的练习赛,主要是为了过几天的校园招聘测试做练习用的,帮助熟悉平台,题目嘛,个人觉得除了A题外,B和C就是练习基本编程的。A题:Bad Horse二分图判定问题。话说昨晚刚简单看了一下代码,写都没写过,只好翻书抄代码了...还是有点幸运的,如果昨天没看,这个题估计就要留白了...感觉还有好多东西没学啊... 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace s... 阅读全文
posted @ 2013-09-14 19:26
xiaobaibuhei
阅读(580)
评论(2)
推荐(0)
摘要:
题目大意:给一个三维迷宫,给出入口和出口,找出最短路径。 无权图上的单源最短路问题,使用BFS解决。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define MAXN 35 6 7 const int dir[5][2] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}, {-1, 1}}; 8 int G[MAXN][MAXN][MAXN], dist[MAXN*MAXN*MAXN]; 9 int L, R, C;10 int s, e;11 12 int bfs()13 {14 ... 阅读全文
posted @ 2013-09-14 09:33
xiaobaibuhei
阅读(180)
评论(0)
推荐(0)

浙公网安备 33010602011771号