| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 140007 | 叶航帅 | 扫雷游戏 | Python3 | Wrong Answer | 30 MS | 3832 KB | 972 | 2025-12-13 14:31:14 |
mines =[ "???**", "????*", "??**?", "???*?"] b = [ [0 for x in range(5)] for y in range(4)] for row in b: print(row) for i in range(4): for j in range(5): if mines[i][j]=="*": b[i][j] = "*" else: t = 0 if i-1>=0 and j-1>=0 and mines[i-1][j-1]=="*": t += 1 if i-1>=0 and mines[i-1][j]=="*": t += 1 if i-1>=0 and j+1<=4 and mines[i-1][j+1] == "*": t += 1 if j-1>=0 and mines[i][j-1] == "*": t += 1 if j+1<=4 and mines[i][j+1] == "*": t += 1 if i+1 <= 3 and j-1>=0 and mines[i+1][j-1]=="*": t += 1 if i+1<=3 and mines[i+1][j] == "*": t += 1 if i+1<=3 and j+1<=4 and mines[i+1][j+1] == "*": t += 1 b[i][j] = t for row in b: print(row)
------Input------
30 40 ???*?*???*?????????*?*??*??*???????*???? ?????*???*?*????????*???*?*?**?????????* ??*?**?*?**?????????????*???????**?????* ???*?????*???*???????????????*?????**??? ??*?*??????*?**?*?**??????**??*?*??????? ?*??*??*??***???????????**??**??????*??* ???????**???*?*???????**???????**??**??? ?*????????*???**????*?**?????*?*?????*?? ???????*??*?????*???????***??*?????**??? ????*?*??*????????*??????????*??*??????? ???**??*???????*?*???*????*???**?*?????? ?**???*??*??*????????*?*?**?*?????*???*? ??
------Answer-----
001*3*202*311000001*3*12*32*3210001*1011 01235*414*5*10000012*213*4*3**112221102* 01*3**3*4**2211000011102*3123321**22212* 023*43213*423*321222100112222*23332**111 12*4*211224*5**2*2**100123**44*2*1133211 1*23*22*32***53312221123**33**343213*21* 2221112**335*4*3100113**4211334**11**321 1*10002333*313**2101*3**43212*4*31245*10 1111122*23*20123*2121223***13*42211**210 0013*3*33*21001233*1111124322*43*2222100 123**43*3221111*2*212*3123*323**3*210111 1**322*23*32*12231114*5*3**3*23344*312*1 23210122
------Your output-----
[0, 0, 0, 0, 0] [0, 0, 0, 0, 0] [0, 0, 0, 0, 0] [0, 0, 0, 0, 0] [0, 0, 1, '*', '*'] [0, 1, 3, 5, '*'] [0, 1, '*', '*', 3] [0, 1, 3, '*', 2]