主题:再问一个问题
超大问号
[专家分:60] 发布于 2006-12-02 20:02:00
设有2^n(n<=6)个球队进行单循环比赛,计划在2^n-1天内完成,每个队每天进行一场比赛.设计一个比赛的安排,使在2^n-1天内每个队都与不同的对手比赛.例如n=2时的比赛安排为:
队 1 2 3 4
比赛 1-2 3-4 第一天
1-3 2-4 第二天
1-4 2-3 第三天
怎么做
回复列表 (共8个回复)
沙发
moz [专家分:37620] 发布于 2006-12-02 20:17:00
旧贴里有很多,慢慢翻吧,没耐心了,
再:如再用这种标题,将会被删.
板凳
超大问号 [专家分:60] 发布于 2006-12-03 17:04:00
哦,我是刚来的。谢谢您的提醒!
3 楼
黑白猪-- [专家分:420] 发布于 2007-03-26 11:10:00
本题属于进制转换
CLS
INPUT N
M = 2 ^ N
DIM B(M), A(M, M)
FOR K = 1 TO M - 1
FOR I = 1 TO M: B(I) = 0: NEXT I
PRINT "第"; K; "天";
FOR I = 1 TO M
IF B(I) = 0 THEN
B(I) = 1: PRINT I;
FOR J = 1 TO M
IF B(J) = 0 AND A(I, J) = 0 THEN
PRINT "-"; J;
B(J) = 1: A(I, J) = 1: A(J, I) = 1
EXIT FOR
END IF
NEXT J
END IF
NEXT I: PRINT
NEXT K
END
[em9]
4 楼
游戏之王 [专家分:540] 发布于 2007-03-29 16:09:00
CLS
INPUT N
M = 2 ^ N
DIM B(M), A(M, M)
FOR K = 1 TO M - 1
FOR I = 1 TO M: B(I) = 0: NEXT I
PRINT "第"; K; "天";
FOR I = 1 TO M
IF B(I) = 0 THEN
B(I) = 1: PRINT I;
FOR J = 1 TO M
IF B(J) = 0 AND A(I, J) = 0 THEN
PRINT "-"; J;
B(J) = 1: A(I, J) = 1: A(J, I) = 1
EXIT FOR
END IF
NEXT J
END IF
NEXT I: PRINT
NEXT K
END
5 楼
超大问号 [专家分:60] 发布于 2007-03-30 19:07:00
最好写点思路
谢谢
6 楼
小精灵LS [专家分:580] 发布于 2007-04-01 16:31:00
CLS
INPUT N
M = 2 ^ N
DIM B(M), A(M, M)
FOR K = 1 TO M - 1
FOR I = 1 TO M: B(I) = 0: NEXT I
PRINT "第"; K; "天";
FOR I = 1 TO M
IF B(I) = 0 THEN
B(I) = 1: PRINT I;
FOR J = 1 TO M
IF B(J) = 0 AND A(I, J) = 0 THEN
PRINT "-"; J;
B(J) = 1: A(I, J) = 1: A(J, I) = 1: EXIT FOR
END IF
NEXT J
END IF
NEXT I: PRINT
NEXT K
END
7 楼
冰冻小企鹅 [专家分:190] 发布于 2009-02-09 11:27:00
本题属于进制转换
CLS
INPUT N
M = 2 ^ N
DIM B(M), A(M, M)
FOR K = 1 TO M - 1
FOR I = 1 TO M: B(I) = 0: NEXT I
PRINT "第"; K; "天";
FOR I = 1 TO M
IF B(I) = 0 THEN
B(I) = 1: PRINT I;
FOR J = 1 TO M
IF B(J) = 0 AND A(I, J) = 0 THEN
PRINT "-"; J;
B(J) = 1: A(I, J) = 1: A(J, I) = 1
EXIT FOR
END IF
NEXT J
END IF
NEXT I: PRINT
NEXT K
END
8 楼
冰冻小企鹅 [专家分:190] 发布于 2009-02-09 11:33:00
也给我点分吧!
我来回复