浙传桐乡好还是下沙好今年还是按照1:4发证吗

2018年浙传播音专业是在复试还是在三试发证_百度知道
2018年浙传播音专业是在复试还是在三试发证
2018年浙传播音专业是在复试还是在三试发证
我有更好的答案
通常要考试结束后才发合格证。如果有三试的话,就是三试之后才发。
采纳率:93%
来自团队:
为您推荐:
您可能关注的内容
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。浙传11广1宣传【人人网 - 分享】
浙传11广1宣传
分享这个视频的人喜欢
分享这个视频的人也爱看
那个快乐的小二货又回来了??
早早早早早早早早早早
我们好像在哪见过
掉粉了不开心…
缘分有深浅守护才温暖
热门视频推荐
热门日志推荐
同类视频推荐
北京千橡网景科技发展有限公司:
文网文[号··京公网安备号·甲测资字
文化部监督电子邮箱:wlwh@vip.sina.com··
文明办网文明上网举报电话: 举报邮箱:&&&&&&&&&&&&
请输入手机号,完成注册
请输入验证码
密码必须由6-20个字符组成
下载人人客户端
品评校花校草,体验校园广场在浙江传媒学院就读是怎么在一番体验? - 知乎65被浏览<strong class="NumberBoard-itemValue" title="6分享邀请回答5120 条评论分享收藏感谢收起1211 条评论分享收藏感谢收起1909人阅读
数据结构+算法(28)
问题 F: Hexagon Game
时间限制: 1 Sec
内存限制: 128 MB提交: 5
Case #1: Nobody wins
Case #2: Blue wins
Case #3: Red wins
Case #4: Impossible
Case #5: Blue wins
Case #6: Impossible
Case #7: Blue wins
1、首先进行六边形棋盘与矩形的转换:
关于方向上的问题解决方案如下:
如上图所示,以6为中心,在矩形内本该有上、下、左、右、左上、左下、右上、右下8个遍历方向,由于六边形六条边面的特性(只与周围其他六个六边形相连),即没有左上和右下的方向。
2、获胜的条件:
(1)所给的棋盘状态下的棋子摆放合理:
(i)按照每人每次轮流下一步的规则,两种颜色的棋子总数最多相差一个,或者相等。
(ii)按照规则,一旦有一方获胜游戏即刻停止。即不可能出现某一方获胜两次及以上,或者,两方都获胜的情况。
(2)对于红方:红色棋子将棋盘的上下边相连。
对于蓝方:蓝色棋子将棋盘的左右边相连。
注:本来应该先判断棋盘上的棋子布局是否合理,但是检查合理性会很费时,应当先检查输赢或者与检查输赢一起进行。
import java.util.S
public class Main {
//定义四种游戏最终状态,并与RESULT里的字符串一一对应
public static final int BLUE_WINS = 0;
public static final int IMPOSSIBLE = 1;
public static final int RED_WINS = 2;
public static final int NOBODY_WINS = 3;
public static final String[] RESULT = { "Blue wins", "Impossible",
"Red wins", "Nobody wins" };
//蓝方和红方赢得比赛的次数
public static int blueWinCount = 0;
public static int redWinCount = 0;
* 判断双方的棋子数量是否合理(双方棋子数量的差的绝对值不超过1),因为是轮流每人下一颗棋
* @param map
private static boolean isCellNumberReasonable(char[][] map) {
int bCount = 0, rCount = 0;
for (int i = 0; i & map. i++) {
for (int j = 0; j & map. j++) {
if (map[i][j] == 'B') {
} else if (map[i][j] == 'R') {
// System.out.println("CountCha=" + Math.abs(bCount - rCount));
return Math.abs(bCount - rCount) &= 1;
* 判断蓝方是否赢得比赛
* @param map
* @param x
* @param y
public static boolean isBlueWin(char[][] map, int x, int y) {
map[x][y] = '.';//将遍历过的位置改为“.”,防止出现循环遍历的情况
if (y == map.length - 1) {
blueWinCount++;
if (y - 1 &= 0 && map[x][y - 1] == 'B') {
isBlueWin(map, x, y - 1);
// RIGHT_UP
if (x + 1 & map.length && y - 1 &= 0 && map[x + 1][y - 1] == 'B') {
isBlueWin(map, x + 1, y - 1);
if (x + 1 & map.length && map[x + 1][y] == 'B') {
isBlueWin(map, x + 1, y);
if (y + 1 & map.length && map[x][y + 1] == 'B') {
isBlueWin(map, x, y + 1);
// LEFT_DOWN
if (x - 1 &= 0 && y + 1 & map.length && map[x - 1][y + 1] == 'B') {
isBlueWin(map, x - 1, y + 1);
if (x - 1 &= 0 && map[x - 1][y] == 'B') {
isBlueWin(map, x - 1, y);
return blueWinCount &= 1;
* 判断红方是否赢得比赛
* @param map
* @param x
* @param y
private static boolean isRedWin(char[][] map, int x, int y) {
map[x][y] = '.';//将遍历过的位置改为“.”,防止出现循环遍历的情况
if (x == map.length - 1) {
redWinCount++;
if (y - 1 &= 0 && map[x][y - 1] == 'R') {
isRedWin(map, x, y - 1);
// RIGHT_UP
if (x + 1 & map.length && y - 1 &= 0 && map[x + 1][y - 1] == 'R') {
isRedWin(map, x + 1, y - 1);
if (x + 1 & map.length && map[x + 1][y] == 'R') {
isRedWin(map, x + 1, y);
if (y + 1 & map.length && map[x][y + 1] == 'R') {
isRedWin(map, x, y + 1);
// LEFT_DOWN
if (x - 1 &= 0 && y + 1 & map.length && map[x - 1][y + 1] == 'R') {
isRedWin(map, x - 1, y + 1);
if (x - 1 &= 0 && map[x - 1][y] == 'R') {
isRedWin(map, x - 1, y);
return redWinCount &= 1;
* 得到最终结果
* @param map
public static int judge(char[][] map) {
int n = map.
int state = NOBODY_WINS;
// 由于isBlueWin和isRedWin两个方法会修改map里的数据,所以要提前判断棋子数量书否合理
boolean isCellNumberReasonable = isCellNumberReasonable(map);
for (int i = 0; i & i++) {
if (map[i][0] == 'B' && isBlueWin(map, i, 0)) {
state = BLUE_WINS;
if (map[0][i] == 'R' && isRedWin(map, 0, i)) {
state = RED_WINS;
// 如果蓝方和红方赢得比赛的次数超过1,或者,棋子数量不合理,则判定游戏当前状态为impossible
if (blueWinCount + redWinCount & 1 || !isCellNumberReasonable) {
state = IMPOSSIBLE;
// System.out.println("WinCount=" + (blueWinCount + redWinCount));
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int z = cin.nextInt();
for (int j = 1; j &= j++) {
int n = cin.nextInt();
char[][] map = new char[n][n];
for (int i = 0; i & map. i++) {
map[i] = cin.next().toCharArray();
// 每次初始化蓝方和红方赢得比赛的次数
blueWinCount = 0;
redWinCount = 0;
System.out.println("Case #" + j + ": " + RESULT[judge(map)]);
#算法有Bug,日后再改。

我要回帖

更多关于 浙传学生信息门户登录 的文章

 

随机推荐