鱼C论坛

 找回密码
 立即注册
查看: 5220|回复: 20

[技术交流] Python:每日一题 123

[复制链接]
发表于 2017-11-12 20:54:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 冬雪雪冬 于 2017-11-19 15:11 编辑

先我们的玩法做了一下改变:
1. 楼主不再提供答案。
2. 请大家先独立思考”,再参考其他鱼油的解答,这样才有助于自己编程水平的提高。
3. 鼓励大家积极答题,奖励的期限为出题后24小时内。
4. 根据答案的质量给予1~3鱼币的奖励。
题目:
有如下的一个10X10的迷宫,从左往右自A1进入,遇到1方向不变直行,遇到2右转90°,遇到3转180°即掉头,遇到4左转90°,直到从右下角A10走出。统计你走过的格子的数字之和,注意重复走过的格子只算一次,如D4走过2次,计数只算1。
1.jpg





1        1        1        2        1        1        2        4        4        3
2        1        1        1        1        1        1        1        4        2
1        2        3        1        4        2        1        1        2        4
2        1        1        1        1        1        2        1        4        1
1        1        1        3        2        2        3        1        2        3
3        2        4        1        1        1        1        1        1        4
2        1        1        1        1        2        2        1        4        1
1        2        1        3        2        1        2        4        1        4
1        2        1        1        1        1        4        2        2        2
2        1        2        1        2        2        3        4        1        1

=========================================
答案是:113
走过的路径如下:
2.jpg


本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2017-11-12 23:30:13 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2017-11-13 08:30:04 | 显示全部楼层
和是112
经过81步

  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Sun Nov 12 22:34:26 2017


  4. """

  5. puzzle =[

  6. [1,        1,        1,        2,        1,        1,        2,        4,        4,        3],
  7. [2,        1,        1,        1,        1,        1,        1,        1,        4,        2],
  8. [1,        2,        3,        1,        4,        2,        1,        1,        2,        4],
  9. [2,        1,        1,        1,        1,        1,        2,        1,        4,        1],
  10. [1,        1,        1,        3,        2,        2,        3,        1,        2,        3],
  11. [3,        2,        4,        1,        1,        1,        1,        1,        1,        4],
  12. [2,        1,        1,        1,        1,        2,        2,        1,        4,        1],
  13. [1,        2,        1,        3,        2,        1,        2,        4,        1,        4],
  14. [1,        2,        1,        1,        1,        1,        4,        2,        2,        2],
  15. [2,        1,        2,        1,        2,        2,        3,        4,        1,        1]
  16. ]


  17. def next_step(ind_row, ind_col, cur_dir, cur_val):
  18.     if cur_dir == 1:
  19.         if(cur_val == 1):
  20.            next_dir = 1
  21.            next_row = ind_row
  22.            next_col = ind_col+1
  23.         elif cur_val == 2:
  24.            next_dir = 4
  25.            next_row = ind_row +1
  26.            next_col = ind_col
  27.         elif cur_val == 3:
  28.            next_dir = 3
  29.            next_row = ind_row
  30.            next_col = ind_col - 1
  31.         elif cur_val == 4:
  32.            next_dir = 2
  33.            next_row = ind_row -1
  34.            next_col = ind_col
  35.         else:
  36.            print ("Error direction")            
  37.     elif cur_dir == 2:
  38.         if(cur_val == 1):
  39.            next_dir = 2
  40.            next_row = ind_row -1
  41.            next_col = ind_col
  42.         elif cur_val == 2:
  43.            next_dir = 1
  44.            next_row = ind_row
  45.            next_col = ind_col + 1
  46.         elif cur_val == 3:
  47.            next_dir = 4
  48.            next_row = ind_row + 1
  49.            next_col = ind_col
  50.         elif cur_val == 4:
  51.            next_dir = 3
  52.            next_row = ind_row
  53.            next_col = ind_col -1
  54.         else:
  55.            print ("Error direction")            
  56.     elif cur_dir == 3:
  57.         if(cur_val == 1):
  58.            next_dir = 3
  59.            next_row = ind_row
  60.            next_col = ind_col - 1
  61.         elif cur_val == 2:
  62.            next_dir = 2
  63.            next_row = ind_row - 1
  64.            next_col = ind_col
  65.         elif cur_val == 3:
  66.            next_dir = 1
  67.            next_row = ind_row
  68.            next_col = ind_col + 1
  69.         elif cur_val == 4:
  70.            next_dir = 4
  71.            next_row = ind_row + 1
  72.            next_col = ind_col
  73.         else:
  74.            print ("Error direction")            
  75.     elif cur_dir == 4:
  76.         if(cur_val == 1):
  77.            next_dir = 4
  78.            next_row = ind_row + 1
  79.            next_col = ind_col
  80.         elif cur_val == 2:
  81.            next_dir = 3
  82.            next_row = ind_row
  83.            next_col = ind_col - 1
  84.         elif cur_val == 3:
  85.            next_dir = 2
  86.            next_row = ind_row - 1
  87.            next_col = ind_col
  88.         elif cur_val == 4:
  89.            next_dir = 1
  90.            next_row = ind_row
  91.            next_col = ind_col + 1
  92.         else:
  93.            print ("Error direction")            
  94.     else:
  95.         print ("Error direction")            
  96.         
  97.            
  98.     return [next_row, next_col, next_dir]     


  99. p_row = len(puzzle)
  100. p_col = len(puzzle[0])
  101. pos_pass = [[0 for i in range(p_col)] for j in range(p_row)]

  102. cur_dir = 1
  103. ind_row = 0
  104. ind_col = 0
  105. cur_val = puzzle[ind_row][ind_col]
  106. sum_val = cur_val
  107. #next_step(ind_row, ind_col, cur_dir, cur_val):
  108. next_time = next_step(ind_row, ind_col, cur_dir, cur_val)

  109. pos_pass[ind_row][ind_col] = 1
  110. steps = 2

  111. while(next_time[0]<p_row-1 or next_time[1]<p_col-1):
  112.     ind_row = next_time[0]
  113.     ind_col = next_time[1]
  114.     cur_dir = next_time[2]
  115.     cur_val = puzzle[ind_row][ind_col]
  116.     if pos_pass[ind_row][ind_col] == 0:
  117.         sum_val = sum_val + puzzle[ind_row][ind_col]
  118.     pos_pass[ind_row][ind_col] = steps
  119.         
  120.     steps = steps +1
  121.     next_time = next_step(ind_row, ind_col, cur_dir, cur_val)

  122. print(sum_val)
  123. for i in pos_pass:
  124.     print(i)
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 1 反对 0

使用道具 举报

发表于 2017-11-13 13:30:10 | 显示全部楼层
  1. matrix = [
  2. [1,1,1,2,1,1,2,4,4,3],
  3. [2,1,1,1,1,1,1,1,4,2],
  4. [1,2,3,1,4,2,1,1,2,4],
  5. [2,1,1,1,1,1,2,1,4,1],
  6. [1,1,1,3,2,2,3,1,2,3],
  7. [3,2,4,1,1,1,1,1,1,4],
  8. [2,1,1,1,1,2,2,1,4,1],
  9. [1,2,1,3,2,1,2,4,1,4],
  10. [1,2,1,1,1,1,4,2,2,2],
  11. [2,1,2,1,2,2,3,4,1,1]]
  12. def nextpos(x,y,px,py,matrix=matrix):
  13.         if matrix[x][y]==1: return 2*x-px,2*y-py
  14.         elif matrix[x][y]==2:
  15.                 if x-px==0 and y-py==1: return x+1,y
  16.                 elif x-px==-1 and y-py==0: return x,y+1
  17.                 elif x-px==0 and y-py==-1: return x-1,y
  18.                 elif x-px==1 and y-py==0: return x,y-1
  19.         elif matrix[x][y]==3: return px,py
  20.         elif matrix[x][y]==4:
  21.                 if x-px==0 and y-py==1: return x-1,y
  22.                 elif x-px==-1 and y-py==0: return x,y-1
  23.                 elif x-px==0 and y-py==-1: return x+1,y
  24.                 elif x-px==1 and y-py==0: return x,y+1

  25. prev=(0,0)
  26. cur=(0,1)
  27. pos=[(0,0),(0,1)]
  28. while cur!=(9,9):
  29.         next = nextpos(cur[0],cur[1],prev[0],prev[1])
  30.         prev = cur
  31.         cur = next
  32.         pos.append(cur)
  33. print(sum(matrix[x][y] for x,y in set(pos)))
复制代码

113
[Finished in 0.1s]

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 1 反对 0

使用道具 举报

发表于 2017-11-13 13:40:02 | 显示全部楼层

  1. import copy

  2. def f(n,speed):
  3.    
  4.     if n==1:
  5.         speed = speed

  6.     if n==2:
  7.         if speed[0]==0:
  8.             if speed[1]==1:
  9.                 speed[0]=-1
  10.             if speed[1]==-1:
  11.                 speed[0]=1
  12.             speed[1]=0

  13.         elif speed[1]==0:
  14.             if speed[0]==-1:
  15.                 speed[1]=-1
  16.             if speed[0]==1:
  17.                 speed[1]=1
  18.             speed[0]=0
  19.             
  20.     if n==3:
  21.         speed=[i*-1 for i in speed]

  22.     if n==4:
  23.         if speed[0]==0:
  24.             if speed[1]==1:
  25.                 speed[0]=1
  26.             if speed[1]==-1:
  27.                 speed[0]=-1
  28.             speed[1]=0

  29.         elif speed[1]==0:
  30.             if speed[0]==-1:
  31.                 speed[1]=1
  32.             if speed[0]==1:
  33.                 speed[1]=-1
  34.             speed[0]=0
  35.             
  36.     return speed

  37. speed=[0,1]

  38. game=[[1, 1, 1, 2, 1, 1, 2, 4, 4, 3],
  39.       [2, 1, 1, 1, 1, 1, 1, 1, 4, 2],
  40.       [1, 2, 3, 1, 4, 2, 1, 1, 2, 4],
  41.       [2, 1, 1, 1, 1, 1, 2, 1, 4, 1],
  42.       [1, 1, 1, 3, 2, 2, 3, 1, 2, 3],
  43.       [3, 2, 4, 1, 1, 1, 1, 1, 1, 4],
  44.       [2, 1, 1, 1, 1, 2, 2, 1, 4, 1],
  45.       [1, 2, 1, 3, 2, 1, 2, 4, 1, 4],
  46.       [1, 2, 1, 1, 1, 1, 4, 2, 2, 2],
  47.       [2, 1, 2, 1, 2, 2, 3, 4, 1, 1]]
  48. a=copy.deepcopy(game)
  49. c=[]
  50. x,y=0,0
  51. time=0
  52. while x !=10 and y !=10:
  53.     n=game[y][x]
  54.     c.append(a[y][x])
  55.     a[y][x]=0
  56.     time +=1
  57.     print(n,'→',end='')
  58.     speed=f(n,speed)
  59.     x=x+speed[1]
  60.     y=y+(-1*speed[0])

  61. print('\n','answer=',sum(c))
  62.    
复制代码

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-13 14:56:37 | 显示全部楼层
  1. s = '''1        1        1        2        1        1        2        4        4        3
  2. 2        1        1        1        1        1        1        1        4        2
  3. 1        2        3        1        4        2        1        1        2        4
  4. 2        1        1        1        1        1        2        1        4        1
  5. 1        1        1        3        2        2        3        1        2        3
  6. 3        2        4        1        1        1        1        1        1        4
  7. 2        1        1        1        1        2        2        1        4        1
  8. 1        2        1        3        2        1        2        4        1        4
  9. 1        2        1        1        1        1        4        2        2        2
  10. 2        1        2        1        2        2        3        4        1        1'''
  11. ss = ''
  12. for i in s:
  13.     if i != ' ':
  14.       ss += i
  15. road = [list(i) for i in ss.splitlines()]
  16. a = 0
  17. b = 0
  18. ort = 'R'
  19. result = dict()

  20. def in_box(a):
  21.     if a not in range(10):
  22.         return False
  23.     return True

  24. def walk(a,b,ort,result,road):
  25.     ab = str(a) + str(b)
  26.     result.update({ab: road[a][b]})
  27.     if road[a][b] == '1':
  28.         ort == ort
  29.         if ort == 'R':
  30.             b += 1
  31.         elif ort == 'L':
  32.             b -= 1
  33.         elif ort == 'U':
  34.             a -= 1
  35.         elif ort == 'D':
  36.             a += 1
  37.     elif road[a][b] == '2':
  38.         if ort == 'R':
  39.             a += 1
  40.             ort = 'D'
  41.         elif ort == 'L':
  42.             a -= 1
  43.             ort = 'U'
  44.         elif ort == 'U':
  45.             b += 1
  46.             ort = 'R'
  47.         elif ort == 'D':
  48.             b -= 1
  49.             ort = 'L'
  50.     elif road[a][b] == '3':
  51.         if ort == 'R':
  52.             b -= 1
  53.             ort = 'L'
  54.         elif ort == 'L':
  55.             b += 1
  56.             ort = 'R'
  57.         elif ort == 'U':
  58.             a += 1
  59.             ort = 'D'
  60.         elif ort == 'D':
  61.             a -= 1
  62.             ort = 'U'
  63.     elif road[a][b] == '4':
  64.         if ort == 'R':
  65.             a -= 1
  66.             ort = 'U'
  67.         elif ort == 'L':
  68.             a += 1
  69.             ort = 'D'
  70.         elif ort == 'U':
  71.             b -= 1
  72.             ort = 'L'
  73.         elif ort == 'D':
  74.             b += 1
  75.             ort = 'R'
  76.     if a == 9 and b == 9:
  77.         ab = str(9) + str(9)
  78.         result.update({ab:road[9][9]})
  79.         return result
  80.     if in_box(a) or in_box(b):
  81.         walk(a, b, ort, result, road)
  82.     return result
  83. r = walk(a,b,ort,result,road)
  84. print(sum(int(i) for i in r.values()))
复制代码

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-13 18:34:04 | 显示全部楼层
肯定是一组唯一的设定好的数字
思维定格了,想不到有什么很纯粹的处理
只好按照题目当成走迷宫来处理了
  1. maze_ex = """
  2. 1        1        1        2        1        1        2        4        4        3
  3. 2        1        1        1        1        1        1        1        4        2
  4. 1        2        3        1        4        2        1        1        2        4
  5. 2        1        1        1        1        1        2        1        4        1
  6. 1        1        1        3        2        2        3        1        2        3
  7. 3        2        4        1        1        1        1        1        1        4
  8. 2        1        1        1        1        2        2        1        4        1
  9. 1        2        1        3        2        1        2        4        1        4
  10. 1        2        1        1        1        1        4        2        2        2
  11. 2        1        2        1        2        2        3        4        1        1"""

  12. def fun(maze):
  13.     functions = [lambda pos: (pos[0], pos[1]+1),
  14.                  lambda pos: (pos[0]+1, pos[1]),
  15.                  lambda pos: (pos[0], pos[1]-1),
  16.                  lambda pos: (pos[0]-1, pos[1])] # 右、下、左、上
  17.     maze_str = (j.split() for j in maze.strip().split('\n'))
  18.     maze = [[int(i) for i in j] for j in maze_str]
  19.     row, column = len(maze), len(maze[0])
  20.    
  21.     flag = [[0] * column for _ in range(row)] # 标记路径
  22.     flag[0][0] = 1
  23.     x, y, direction  = 0, 0, 0 # 初始行坐标、列坐标、移动方向

  24.     while (x, y) != (row -1, column -1):
  25.         direction = (direction + maze[x][y] - 1) % 4
  26.         x, y = functions[direction]((x,y))
  27.         flag[x][y] = 1
  28.     return sum(maze[i][j] for i in range(row) for j in range(column) if flag[i][j])
复制代码

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-13 19:49:02 | 显示全部楼层
我想,应该涉及到矩阵旋转之类的,

可以考虑map()与zip()什么的,

具体思路,没有......55555
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-14 00:00:16 From FishC Mobile | 显示全部楼层
到头了怎么走,从另一端进入?贪吃蛇吗
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-14 00:02:20 | 显示全部楼层
本帖最后由 wyp02033 于 2017-11-14 16:11 编辑
  1. def main():

  2.     maze = [[1, 1, 1, 2, 1, 1, 2, 4, 4, 3],
  3.             [2, 1, 1, 1, 1, 1, 1, 1, 4, 2],
  4.             [1, 2, 3, 1, 4, 2, 1, 1, 2, 4],
  5.             [2, 1, 1, 1, 1, 1, 2, 1, 4, 1],
  6.             [1, 1, 1, 3, 2, 2, 3, 1, 2, 3],
  7.             [3, 2, 4, 1, 1, 1, 1, 1, 1, 4],
  8.             [2, 1, 1, 1, 1, 2, 2, 1, 4, 1],
  9.             [1, 2, 1, 3, 2, 1, 2, 4, 1, 4],
  10.             [1, 2, 1, 1, 1, 1, 4, 2, 2, 2],
  11.             [2, 1, 2, 1, 2, 2, 3, 4, 1, 1]]

  12.     width = height = 9
  13.     speed = [0, 1]
  14.     start = [0, 0]
  15.     end = [9, 9]
  16.     position = start
  17.     passed_position = []
  18.     all_num_sum = 0

  19.     while True:
  20.         
  21.         position_str = str(position[0]) + str(position[1])
  22.         if position_str not in passed_position:
  23.             passed_position.append(position_str)
  24.         i, j = position

  25.         #定义右转
  26.         if maze[i][j] == 2:
  27.             if speed == [1, 0]:
  28.                 speed = [0, -1]
  29.             elif speed == [0, -1]:
  30.                 speed = [-1, 0]
  31.             elif speed == [-1, 0]:
  32.                 speed = [0, 1]
  33.             else:
  34.                 speed = [1, 0]
  35.         #定义反向
  36.         elif maze[i][j] == 3:
  37.             speed[0] = -speed[0]
  38.             speed[1] = -speed[1]
  39.         #定义左转
  40.         elif  maze[i][j] == 4:
  41.             if speed == [1, 0]:
  42.                 speed = [0, 1]
  43.             elif speed == [0, 1]:
  44.                 speed = [-1, 0]
  45.             elif speed == [-1, 0]:
  46.                 speed = [0, -1]
  47.             else:
  48.                 speed = [1, 0]
  49.         else:
  50.             pass

  51.         position[0] += speed[0]
  52.         position[1] += speed[1]
  53.         if position[0] > width:
  54.             position[0] = 0
  55.         elif position[0] < 0:
  56.             position[0] = width
  57.         elif position[1] > height:
  58.             position[1] = 0
  59.         elif position[1] < 0:
  60.             position[1] = height

  61.         if position == end:
  62.             passed_position.append(str(end[0]) + str(end[1]))

  63.             break

  64.     for each in passed_position:
  65.         i, j = int(each[0]), int(each[1])
  66.         all_num_sum += maze[i][j]


  67.     print(all_num_sum)

  68. if __name__ == "__main__":
  69.     main()
复制代码

运行结果:113

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-14 16:37:40 | 显示全部楼层
  1. import numpy as np

  2. arr = '''
  3. 1 1 1 2 1 1 2 4 4 3
  4. 2 1 1 1 1 1 1 1 4 2
  5. 1 2 3 1 4 2 1 1 2 4
  6. 2 1 1 1 1 1 2 1 4 1
  7. 1 1 1 3 2 2 3 1 2 3
  8. 3 2 4 1 1 1 1 1 1 4
  9. 2 1 1 1 1 2 2 1 4 1
  10. 1 2 1 3 2 1 2 4 1 4
  11. 1 2 1 1 1 1 4 2 2 2
  12. 2 1 2 1 2 2 3 4 1 1
  13. '''
  14. a = np.fromstring(arr, int, sep=' ').reshape(10,10)
  15. z = np.zeros_like(a)

  16. def fn():
  17.     cood = np.array([0,0]) #当前坐标
  18.     rot = np.array([[0,1],[1,0],[0,-1],[-1,0]]) #转向
  19.     dirct = 0 # 方向
  20.     while cood.tolist() != [9,9]:
  21.         val = a[tuple(cood)]
  22.         z[tuple(cood)] = val
  23.         dirct = (dirct+val-1)%4
  24.         cood += rot[dirct]
  25.     z[9,9] = a[9,9]
  26.     return z.sum()
  27.         
  28. s = fn()
  29. print(s) # 113
复制代码

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-14 18:40:49 | 显示全部楼层
  1. import numpy as np
  2. a=np.array ([1,1,1,2,1,1,2,4,4,3])
  3. b=np.array ([2,1,1,1,1,1,1,1,4,2])
  4. c=np.array ([1,2,3,1,4,2,1,1,2,4])
  5. d=np.array ([2,1,1,1,1,1,2,1,4,1])
  6. e=np.array ([1,1,1,3,2,2,3,1,2,3])
  7. f= np.array([3,2,4,1,1,1,1,1,1,4])
  8. g =np.array([2,1,1,1,1,2,2,1,4,1])
  9. h =np.array([1,2,1,3,2,1,2,4,1,4])
  10. i =np.array([1,2,1,1,1,1,4,2,2,2])
  11. j= np.array([2,1,2,1,2,2,3,4,1,1])
  12. shuzu = np.array([a,b,c,d,e,f,g,h,i,j])
  13. list1=[[0,0]]
  14. i=0
  15. j=0
  16. dir =1
  17. sum =0

  18. while (i,j) != (9,9):
  19.    
  20.         
  21.         
  22.             if dir ==1:
  23.                 if shuzu[i][j] ==1:
  24.                            
  25.                     j = j+1
  26.                     
  27.                     list1.append([i,j])
  28.             
  29.                 elif shuzu[i][j]==2:
  30.                     dir=2
  31.                     i=i+1
  32.                     
  33.                     list1.append([i,j])
  34.                 elif shuzu[i][j]==3:
  35.                     dir =3
  36.                     j=j-1
  37.                     list1.append([i,j])
  38.                 elif shuzu[i][j] ==4:
  39.                     dir =4
  40.                     i= i -1
  41.                     list1.append([i,j])
  42.             
  43.             elif dir ==3:
  44.                
  45.                 if shuzu[i][j] ==1:

  46.                     j=j-1
  47.                     list1.append([i,j])
  48.                 if shuzu[i][j] ==2:
  49.                     dir =4
  50.                     i=i-1
  51.                     list1.append([i,j])
  52.                 if shuzu[i][j]==3:
  53.                     dir=1
  54.                     j=j+1
  55.                   
  56.                     list1.append([i,j])
  57.                 if  shuzu[i][j] ==4:
  58.                      
  59.                     dir =2
  60.                     i=i+1
  61.                     
  62.                     list1.append([i,j])
  63.                   
  64.             elif dir ==2:
  65.                
  66.                 if shuzu[i][j] ==1:
  67.                            
  68.                     i=i+1
  69.                     
  70.                     list1.append([i,j])
  71.                 if shuzu[i][j] ==2:
  72.                     dir =3
  73.                     j=j-1
  74.                     list1.append([i,j])
  75.                 if shuzu[i][j]==3:
  76.                     dir=4
  77.                     i=i-1
  78.                     list1.append([i,j])
  79.                 if  shuzu[i][j] ==4:
  80.                     dir =1
  81.                     j=j+1
  82.                     list1.append([i,j])
  83.                     
  84.             elif dir ==4:
  85.                 if shuzu[i][j] ==1:
  86.                      
  87.                            
  88.                     i=i-1
  89.                     list1.append([i,j])
  90.                 if shuzu[i][j] ==2:
  91.                     dir =1
  92.                     j=j+1
  93.                     
  94.                     list1.append([i,j])
  95.                 if shuzu[i][j]==3:
  96.                     dir=2
  97.                     i=i+1
  98.                     
  99.                     list1.append([i,j])
  100.                 if  shuzu[i][j] ==4:
  101.                      
  102.                     dir =3
  103.                     j=j-1
  104.                     list1.append([i,j])
  105.                     
  106.                      
  107.             
  108.             
  109.            
  110.    
  111. list2=[]
  112. list3=[]
  113. for i in list1:
  114.         if i not in list2:
  115.                 list2.append(i)
  116. print(list2)
  117. for i,j in list2:
  118.          list3.append(shuzu[i][j])
  119. for i in list3:
  120.         sum+=i
  121. print(sum)
复制代码

评分

参与人数 1荣誉 +3 鱼币 +3 收起 理由
冬雪雪冬 + 3 + 3

查看全部评分

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-18 22:02:10 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2017-11-18 22:43:49 | 显示全部楼层
  1. from numpy import *

  2. right = array([0,1])
  3. left = array([0,-1])
  4. up = array([-1,0])
  5. down = array([1,0])

  6. matrix = mat([[1,1,1,2,1,1,2,4,4,3],\
  7.               [2,1,1,1,1,1,1,1,4,2],\
  8.               [1,2,3,1,4,2,1,1,2,4],\
  9.               [2,1,1,1,1,1,2,1,4,1],\
  10.               [1,1,1,3,2,2,3,1,2,3],\
  11.               [3,2,4,1,1,1,1,1,1,4],\
  12.               [2,1,1,1,1,2,2,1,4,1],\
  13.               [1,2,1,3,2,1,2,4,1,4],\
  14.               [1,2,1,1,1,1,4,2,2,2],\
  15.               [2,1,2,1,2,2,3,4,1,1]])

  16. flag = zeros((10,10),dtype = int16)

  17. position = array([0,0])
  18. direction = right
  19. count = 0

  20. while [position[0],position[1]] != [9,9]:

  21.     # 如果没有被踩过,计数
  22.     if not flag[position[0],position[1]]:
  23.         flag[position[0],position[1]] = 1
  24.         count += 1
  25.     # 直走
  26.     if matrix[position[0],position[1]] == 1:
  27.         position += direction
  28.         print(position)
  29.     #碰到2 右转   
  30.     elif matrix[position[0],position[1]] == 2:
  31.         if direction[0] == right[0] and direction[1] == right[1]:
  32.             direction = down
  33.         elif direction[0] == down[0] and direction[1] == down[1]:
  34.             direction = left
  35.         elif direction[0] == left[0] and direction[1] == left[1]:
  36.             direction = up
  37.         elif direction[0] == up[0] and direction[1] == up[1]:
  38.             direction = right
  39.         position += direction
  40.         print(position)
  41.         
  42.     #碰到3 掉头
  43.     elif matrix[position[0],position[1]] == 3:
  44.         if direction[0] == right[0] and direction[1] == right[1]:
  45.             direction = left
  46.         elif direction[0] == left[0] and direction[1] == left[1]:
  47.             direction = right
  48.         elif direction[0] == up[0] and direction[1] == up[1]:
  49.             direction = down
  50.         elif direction[0] == down[0] and direction[1] == down[1]:
  51.             direction = up
  52.         position += direction
  53.         print(position)

  54.     #碰到4 左转
  55.     elif matrix[position[0],position[1]] == 4:
  56.         if direction[0] == right[0] and direction[1] == right[1]:
  57.             direction = up
  58.         elif direction[0] == up[0] and direction[1] == up[1]:
  59.             direction = left
  60.         elif direction[0] == left[0] and direction[1] == left[1]:
  61.             direction = down
  62.         elif direction[0] == down[0] and direction[1] == down[1]:
  63.             direction = right
  64.         position += direction
  65.         print(position)

  66. print(count)

  67. # result
  68. '''
  69. [0 1]
  70. [0 2]
  71. [0 3]
  72. [1 3]
  73. [2 3]
  74. [3 3]
  75. [4 3]
  76. [3 3]
  77. [2 3]
  78. [1 3]
  79. [0 3]
  80. [0 4]
  81. [0 5]
  82. [0 6]
  83. [1 6]
  84. [2 6]
  85. [3 6]
  86. [3 5]
  87. [3 4]
  88. [3 3]
  89. [3 2]
  90. [3 1]
  91. [3 0]
  92. [2 0]
  93. [1 0]
  94. [1 1]
  95. [1 2]
  96. [1 3]
  97. [1 4]
  98. [1 5]
  99. [1 6]
  100. [1 7]
  101. [1 8]
  102. [0 8]
  103. [0 7]
  104. [1 7]
  105. [2 7]
  106. [3 7]
  107. [4 7]
  108. [5 7]
  109. [6 7]
  110. [7 7]
  111. [7 8]
  112. [7 9]
  113. [6 9]
  114. [5 9]
  115. [5 8]
  116. [5 7]
  117. [5 6]
  118. [5 5]
  119. [5 4]
  120. [5 3]
  121. [5 2]
  122. [6 2]
  123. [7 2]
  124. [8 2]
  125. [9 2]
  126. [9 1]
  127. [9 0]
  128. [8 0]
  129. [7 0]
  130. [6 0]
  131. [6 1]
  132. [6 2]
  133. [6 3]
  134. [6 4]
  135. [6 5]
  136. [7 5]
  137. [8 5]
  138. [9 5]
  139. [9 4]
  140. [8 4]
  141. [7 4]
  142. [7 5]
  143. [7 6]
  144. [8 6]
  145. [8 7]
  146. [9 7]
  147. [9 8]
  148. [9 9]
  149. 69
  150. '''
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-25 17:03:57 | 显示全部楼层
from migongUI import Ui_Form
from PyQt5 import QtWidgets , QtCore,QtGui
from PyQt5.QtCore import QTimer  #  导入定时器类
import re
import sys
import copy
import time
import threading
"""
有如下的一个10X10的迷宫,从左往右自A1进入,遇到1方向不变直行,遇到2右转90°,遇到3转180°即掉头,
遇到4左转90°,直到从右下角A10走出。统计你走过的格子的数字之和,注意重复走过的格子只算一次,
如D4走过2次,计数只算1。
数列如下
1        1        1        2        1        1        2        4        4        3
2        1        1        1        1        1        1        1        4        2
1        2        3        1        4        2        1        1        2        4
2        1        1        1        1        1        2        1        4        1
1        1        1        3        2        2        3        1        2        3
3        2        4        1        1        1        1        1        1        4
2        1        1        1        1        2        2        1        4        1
1        2        1        3        2        1        2        4        1        4
1        2        1        1        1        1        4        2        2        2
2        1        2        1        2        2        3        4        1        1
"""
class mywindow(QtWidgets.QMainWindow):
    def __init__(self,parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        self.LE_list=[]
        self.timer=QTimer(self)  # 初始化定时器对象
        self.conut=0
        self.timer.timeout.connect(self.showNum)  # 绑定槽函数
        # self.startCount()   # 启动定时器
        self.delay()

    def start(self):
        mycar = Car()
        mydelay = Delay()
        coordinates = int(mycar.hang) * 10 + int(mycar.lie) - 1  # 计算坐标 -1是因为列表从0开始的
        num=""
        result=0
        while coordinates !=99:
            # 设置密码显示,代表mycar的当前位置
            QtWidgets.QLineEdit.setEchoMode(self.LE_list[coordinates], QtWidgets.QLineEdit.PasswordEchoOnEdit)
            num=num+str(coordinates)+'\n'
            self.ui.TE_MID_NUM.setText(num)
            result = result + mycar.num
            self.ui.TE_RECLUT.setText(str(result))
            mycar.num=int(self.LE_list[coordinates].text())
            # 计算前进的方向
            mycar.to_next()
            # 根据方向计算坐标
            mycar.go_step(mycar.direct)
            print(mycar.direct)
            app.processEvents()  # 实时更新
            mydelay.delay_1s()
            QtWidgets.QLineEdit.setEchoMode(self.LE_list[coordinates], QtWidgets.QLineEdit.Normal)
            # 计算坐标对应的文本框
            coordinates = int(mycar.hang) * 10 + int(mycar.lie) - 1
            pass
    def delay(self):
        self.timer.start(1000)
    def showNum(self):
        self.conut=self.conut+1
        # print("dingshiqi",self.conut)
    def Data_init(self,num_list,TE_tmp):
        pass
    def myfindchild(self,P_list,i):
        FindTE =self.findChild((QtWidgets.QLineEdit,), "LE_"+str(i))  # 按名字查找窗口组件
        self.LE_list.append(FindTE)
        QtWidgets.QLineEdit.setText(FindTE,str(P_list))  # 对LineEdit统一赋值

class Car(object):
    # 初始化 行数为0 列数为1 方向向东 数字为0
    def __init__(self):
        self.hang = 0             # 迷宫行坐标
        self.lie = 1              # 迷宫列坐标
        self.direct = 1           # 北 0 东 1  南 2 西 3
        self.num = 1              # 读取迷宫格子的值
    def go_step(self,direct):     # 前进一格
        if self.direct == 0:
            self.hang = self.hang - 1
        if self.direct == 1:
            self.lie = self.lie + 1
        if self.direct == 2:
            self.hang = self.hang + 1
        if self.direct == 3:
            self.lie = self.lie - 1
        return
    def to_next(self):
        if self.num == 1:    # 1 方向不变
            pass
        if self.num == 2:    # 2 方向右转
            self.direct = self.direct+1
            if self.direct > 3:
                self.direct = 0
        if self.num == 3:    # 3 方向掉头
            self.direct = self.direct + 2
            if self.direct > 3:       # 如果大于等于4 需要减去4
                self.direct = self.direct-4
        if self.num == 4:    # 4 方向向左
            self.direct = self.direct + 3
            if self.direct > 3:       # 如果大于等于4 需要减去4
                self.direct = self.direct - 4
class Delay(object):
    # 延时500ms
    def delay_500ms(self):
        time.sleep(0.5)
    # 延时一秒
    def delay_1s(self):
        time.sleep(1)
# 添加线程  实现更新
class mythread(threading.Thread):
    def __init__(self,mywindow):
        threading.Thread.__init__(self)
        self.mywindow=mywindow
    def run(self):
        while i != 99:
            pass

    pass
if __name__ == "__main__":
    list=[[1,1,1,2,1,1,2,4,4,3],
          [2,1,1,1,1,1,1,1,4,2],
          [1,2,3,1,4,2,1,1,2,4],
          [2,1,1,1,1,1,2,1,4,1],
          [1,1,1,3,2,2,3,1,2,3],
          [3,2,4,1,1,1,1,1,1,4],
          [2,1,1,1,1,2,2,1,4,1],
          [1,2,1,3,2,1,2,4,1,4],
          [1,2,1,1,1,1,4,2,2,2],
          [2,1,2,1,2,2,3,4,1,1]]
    app = QtWidgets.QApplication(sys.argv)
    myapp = mywindow()
    myapp.show()
    k=0
    # 迷宫 数字初始化
    for i in range(10):
        for j in range(10):
            # print(list[i][j])
            k = i * 10 + j + 1
            myapp.myfindchild(list[i][j], k)
    sys.exit(app.exec_())

窗口效果

窗口效果
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-11-30 09:47:12 | 显示全部楼层
  1. matrix = [
  2. [1,1,1,2,1,1,2,4,4,3],
  3. [2,1,1,1,1,1,1,1,4,2],
  4. [1,2,3,1,4,2,1,1,2,4],
  5. [2,1,1,1,1,1,2,1,4,1],
  6. [1,1,1,3,2,2,3,1,2,3],
  7. [3,2,4,1,1,1,1,1,1,4],
  8. [2,1,1,1,1,2,2,1,4,1],
  9. [1,2,1,3,2,1,2,4,1,4],
  10. [1,2,1,1,1,1,4,2,2,2],
  11. [2,1,2,1,2,2,3,4,1,1]]

  12. matrixDict = {}
  13. for i in range(10):
  14.     for j in range(10):
  15.         matrixDict[i*10+j] = matrix[i][j]

  16. points = []   # 存放走过的点
  17. pos = [0, 0] # 初始位置
  18. direction = 1 # 初始方向 {1:Right, 2:Left, 3:Up, 4:Down}
  19. points.append(pos[0]*10+pos[1])

  20. while not (pos[0] == 9 and pos[1] == 9):
  21.     if direction == 1:
  22.         pos[1] += 1
  23.         if matrix[pos[0]][pos[1]] == 2: # 右转90°
  24.             direction = 4
  25.         elif matrix[pos[0]][pos[1]] == 3: # 调头
  26.             direction = 2
  27.         elif matrix[pos[0]][pos[1]] == 4: # 左转90°
  28.             direction = 3
  29.     elif direction == 2:
  30.         pos[1] -= 1
  31.         if matrix[pos[0]][pos[1]] == 2: # 右转90°
  32.             direction = 3
  33.         elif matrix[pos[0]][pos[1]] == 3: # 调头
  34.             direction = 1
  35.         elif matrix[pos[0]][pos[1]] == 4: # 左转90°
  36.             direction = 4
  37.     elif direction == 3:
  38.         pos[0] -= 1
  39.         if matrix[pos[0]][pos[1]] == 2: # 右转90°
  40.             direction = 1
  41.         elif matrix[pos[0]][pos[1]] == 3: # 调头
  42.             direction = 4
  43.         elif matrix[pos[0]][pos[1]] == 4: # 左转90°
  44.             direction = 2
  45.     elif direction == 4:
  46.         pos[0] += 1
  47.         if matrix[pos[0]][pos[1]] == 2: # 右转90°
  48.             direction = 2
  49.         elif matrix[pos[0]][pos[1]] == 3: # 调头
  50.             direction = 3
  51.         elif matrix[pos[0]][pos[1]] == 4: # 左转90°
  52.             direction = 1
  53.     points.append(pos[0]*10+pos[1])

  54. points = set(points)

  55. print(sum([matrixDict[i] for i in points]))


  56. # 113
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2017-12-30 09:58:19 | 显示全部楼层
A=[1,2,1,2,1,3,2,1,1,2]
B=[1,1,2,1,1,2,1,2,2,1]
C=[1,1,3,1,1,4,1,1,1,2]
D=[2,1,1,1,3,1,1,3,1,1]
E=[1,1,4,1,2,1,1,2,1,2]
F=[1,1,2,1,2,1,2,1,1,2]
G=[2,1,1,2,3,1,2,2,4,3]
H=[4,1,1,1,1,1,1,4,2,4]
I=[4,4,2,4,2,1,4,1,2,1]
J=[3,2,4,1,3,4,1,4,2,1]

Maze=[A,B,C,D,E,F,G,H,I,J]
Path=set()

i=0
j=0
count=0

direction='E'

while i!=9 or j!=9:
    print(Maze[i][j])
    if Maze[i][j]==1:
        tuple_path=(i,j)
        flage_0=len(Path)
        Path.add(tuple_path)
        flage_1=len(Path)
        if flage_0!=flage_1:
            count+=1
        if direction=='E':
            i+=1
        elif direction=='W':
            i-=1
        elif direction=='N':
            j-=1
        else:
            j+=1
    elif Maze[i][j]==2:
        tuple_path=(i,j)
        flage_0=len(Path)
        Path.add(tuple_path)
        flage_1=len(Path)
        if flage_0!=flage_1:
            count+=2
        if direction=='E':
            j+=1
            direction='S'
        elif direction=='W':
            j-=1
            direction='N'
        elif direction=='N':
            i+=1
            direction='E'
        else:
            i-=1
            direction='W'
    elif Maze[i][j]==3:
        tuple_path=(i,j)
        flage_0=len(Path)
        Path.add(tuple_path)
        flage_1=len(Path)
        if flage_0!=flage_1:
            count+=3
        if direction=='E':
            i-=1
            direction='W'
        elif direction=='W':
            i+=1
            direction='E'
        elif direction=='N':
            j+=1
            direction='S'
        else:
            j-=1
            direction='N'
    else:
        tuple_path=(i,j)
        flage_0=len(Path)
        Path.add(tuple_path)
        flage_1=len(Path)
        if flage_0!=flage_1:
            count+=4
        if direction=='E':
            j-=1
            direction='N'
        elif direction=='W':
            j+=1
            direction='S'
        elif direction=='N':
            i-=1
            direction='W'
        else:
            i+=1
            direction='E'
            
count+=Maze[9][9]  #the last one is not calculate
print(count)
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-2-4 15:30:01 | 显示全部楼层
  1. maze = [
  2. [1,1,1,2,1,1,2,4,4,3],
  3. [2,1,1,1,1,1,1,1,4,2],
  4. [1,2,3,1,4,2,1,1,2,4],
  5. [2,1,1,1,1,1,2,1,4,1],
  6. [1,1,1,3,2,2,3,1,2,3],
  7. [3,2,4,1,1,1,1,1,1,4],
  8. [2,1,1,1,1,2,2,1,4,1],
  9. [1,2,1,3,2,1,2,4,1,4],
  10. [1,2,1,1,1,1,4,2,2,2],
  11. [2,1,2,1,2,2,3,4,1,1]]
  12. step = [0,1]
  13. nowXY = [0,0]
  14. stopXY = [len(maze)-1,len(maze[0])-1]
  15. record = []
  16. path = []
  17. while True:
  18.     now = maze[nowXY[0]][nowXY[1]]
  19.     if nowXY not in record:
  20.         path.append(now)
  21.         record.append(nowXY)
  22.     if nowXY == stopXY:
  23.         break
  24.     if now == 1:
  25.         pass
  26.     elif now == 2:
  27.         if step == [0,1]:
  28.             step = [1,0]
  29.         elif step == [1,0]:
  30.             step = [0,-1]
  31.         elif step == [0,-1]:
  32.             step = [-1,0]
  33.         elif step == [-1,0]:
  34.             step = [0,1]
  35.     elif now == 3:
  36.         if step == [0,1]:
  37.             step = [0,-1]
  38.         elif step == [1,0]:
  39.             step = [-1,0]
  40.         elif step == [0,-1]:
  41.             step = [0,1]
  42.         elif step == [-1,0]:
  43.             step = [1,0]
  44.     elif now == 4:
  45.         if step == [0,1]:
  46.             step = [-1,0]
  47.         elif step == [1,0]:
  48.             step = [0,1]
  49.         elif step == [0,-1]:
  50.             step = [1,0]
  51.         elif step == [-1,0]:
  52.             step = [0,-1]
  53.     nowXY = [x + y for x, y in zip(nowXY, step)]

  54. print(sum(path))

  55. #result
  56. 113
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2019-5-27 23:32:01 | 显示全部楼层
  1. def fun123(x):
  2.     move = [0,1]
  3.     postion,footprint = [0,0],[[0,0]]
  4.     result = x[postion[0]][postion[1]]
  5.     while not postion == [9,9]:
  6.         if x[postion[0]][postion[1]] == 1:
  7.             postion[0] += move[0]
  8.             postion[1] += move[1]
  9.             if postion not in footprint:
  10.                 result += x[postion[0]][postion[1]]
  11.                 footprint.append([postion[0],postion[1]])
  12.             continue
  13.         if x[postion[0]][postion[1]] == 3:
  14.             move[0],move[1] = move[0]*-1,move[1]*-1
  15.             postion[0] += move[0]
  16.             postion[1] += move[1]
  17.             if postion not in footprint:
  18.                 result += x[postion[0]][postion[1]]
  19.                 footprint.append([postion[0],postion[1]])
  20.             continue
  21.         if x[postion[0]][postion[1]] == 2:
  22.             rotating = [[0,1],[1,0],[0,-1],[-1,0],[0,1]]
  23.             move = rotating[rotating.index(move)+1]
  24.             postion[0] += move[0]
  25.             postion[1] += move[1]
  26.             if postion not in footprint:
  27.                 result += x[postion[0]][postion[1]]
  28.                 footprint.append([postion[0],postion[1]])
  29.             continue
  30.         if x[postion[0]][postion[1]] == 4:
  31.             rotating = [[0,1],[-1,0],[0,-1],[1,0],[0,1]]
  32.             move = rotating[rotating.index(move)+1]
  33.             postion[0] += move[0]
  34.             postion[1] += move[1]
  35.             if postion not in footprint:
  36.                 result += x[postion[0]][postion[1]]
  37.                 footprint.append([postion[0],postion[1]])
  38.             continue
  39.     return result

  40. if __name__ == '__main__':
  41.     print(fun123([[1,1,1,2,1,1,2,4,4,3],
  42.                   [2,1,1,1,1,1,1,1,4,2],
  43.                   [1,2,3,1,4,2,1,1,2,4],
  44.                   [2,1,1,1,1,1,2,1,4,1],
  45.                   [1,1,1,3,2,2,3,1,2,3],
  46.                   [3,2,4,1,1,1,1,1,1,4],
  47.                   [2,1,1,1,1,2,2,1,4,1],
  48.                   [1,2,1,3,2,1,2,4,1,4],
  49.                   [1,2,1,1,1,1,4,2,2,2],
  50.                   [2,1,2,1,2,2,3,4,1,1]]))
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2019-8-18 12:28:15 | 显示全部楼层
本帖最后由 永恒的蓝色梦想 于 2019-8-18 12:59 编辑
  1. '''
  2. var d:#方向
  3.   1
  4.   |
  5. 0-+-2
  6.   |
  7.   3

  8. var x,y:#坐标
  9.   |
  10.   |
  11. --+--Y
  12.   |
  13.   |
  14.   X
  15. '''
  16. thelist=[[int(j)for j in i.split()]for i in ''' 1        1        1        2        1        1        2        4        4        3
  17. 2        1        1        1        1        1        1        1        4        2
  18. 1        2        3        1        4        2        1        1        2        4
  19. 2        1        1        1        1        1        2        1        4        1
  20. 1        1        1        3        2        2        3        1        2        3
  21. 3        2        4        1        1        1        1        1        1        4
  22. 2        1        1        1        1        2        2        1        4        1
  23. 1        2        1        3        2        1        2        4        1        4
  24. 1        2        1        1        1        1        4        2        2        2
  25. 2        1        2        1        2        2        3        4        1        1'''.split('\n')];d=2;x,y=0,0;s={(9,9)}
  26. while not x==9==y:
  27.   s.add((x,y));i=thelist[x][y]
  28.   if i==1:pass#1:直行
  29.   elif i==2:d=(d+1)%4#2:右转
  30.   elif i==3:d=(d+2)%4#3:掉头
  31.   elif i==4:d=(d-1)%4#4:左转
  32.   if d==0:y-=1
  33.   elif d==1:x-=1
  34.   elif d==2:y+=1
  35.   elif d==3:x+=1
  36. print(sum((thelist[x][y]for x,y in s)))
复制代码

113
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-25 01:32

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表