4
第四题 英雄救美
source link: https://bbs.pediy.com/thread-267608.htm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
第四题 英雄救美
没心情写wp了,这个题出的,我不想吐槽了。很脑洞不直观
我只想喷出题者。按照他的check,如果不去直接地从最后数独出发。最直接的想法就有 9 ** 55 种可能。
table
=
"$BPV:ubfYp}]DtN>aT^MGmJQ#*Hr`O'wjic0!hdy{oZz-@n+?&%s_/g<e[W)XUxRFSLRA;.l=CEkvK-(q"
垃圾题
# b = [0, 4, 0, 7, 0, 0, 0, 0, 0, 9, 2, 0, 0, 0, 0, 6, 0, 7, 8, 3, 0, 0, 0, 5, 4, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 4, 9, 0, 0, 0, 7, 1, 3, 0, 5, 0, 0, 0, 0, 9, 4, 0, 0, 0, 0, 0, 8, 0, 6, 0, 0]
# import string
# for i in range(9):
# print(a[i*9:i*9 + 9])
垃圾题
# for i in range(9):
# print(b[i*9:i*9 + 9])
垃圾题
# c = []
# zero_count = 0
# aim = [[5,4,6,7,1,9,2,3,8],[9,2,1,8,3,4,6,5,7],[8,3,7,6,2,5,4,1,9],[7,1,8,4,6,3,9,2,5],[4,5,3,2,9,1,7,8,6],[6,9,2,5,8,7,1,4,3],[2,8,4,9,5,6,3,7,1],[3,6,5,1,7,2,8,9,4],[1,7,9,3,4,8,5,6,2]]
# for i in range(81):
# if b[i] == 0:
# zero_count += 1
# c.append(aim[i // 9][i % 9])
# print(c)
# print(len(c))
# print(zero_count)
# idx = 0
# for i in range(len(a)):
# if (i % 9 + 1) == c[idx]:
# print(a[i], end="")
# idx += 1
# print("")
# print(idx)
垃圾题
a
=
[[
0
,
4
,
0
,
7
,
0
,
0
,
0
,
0
,
0
], [
9
,
2
,
0
,
0
,
0
,
0
,
6
,
0
,
7
], [
8
,
3
,
0
,
0
,
0
,
5
,
4
,
0
,
0
], [
0
,
1
,
0
,
0
,
0
,
3
,
0
,
0
,
0
], [
0
,
0
,
0
,
2
,
0
,
1
,
0
,
0
,
0
], [
0
,
0
,
0
,
5
,
0
,
0
,
0
,
4
,
0
], [
0
,
0
,
4
,
9
,
0
,
0
,
0
,
7
,
1
], [
3
,
0
,
5
,
0
,
0
,
0
,
0
,
9
,
4
], [
0
,
0
,
0
,
0
,
0
,
8
,
0
,
6
,
0
]]
b
=
[[
5
,
4
,
6
,
7
,
1
,
9
,
2
,
3
,
8
],[
9
,
2
,
1
,
8
,
3
,
4
,
6
,
5
,
7
],[
8
,
3
,
7
,
6
,
2
,
5
,
4
,
1
,
9
],[
7
,
1
,
8
,
4
,
6
,
3
,
9
,
2
,
5
],[
4
,
5
,
3
,
2
,
9
,
1
,
7
,
8
,
6
],[
6
,
9
,
2
,
5
,
8
,
7
,
1
,
4
,
3
],[
2
,
8
,
4
,
9
,
5
,
6
,
3
,
7
,
1
],[
3
,
6
,
5
,
1
,
7
,
2
,
8
,
9
,
4
],[
1
,
7
,
9
,
3
,
4
,
8
,
5
,
6
,
2
]]
c
=
[]
for
i
in
range
(
9
):
c.append(table[i
*
9
:i
*
9
+
9
])
print
(c)
out
=
""
for
i
in
range
(
9
):
aim
=
a[i]
get
=
b[i]
index_t
=
c[i]
cout
=
0
for
j
in
range
(
9
):
if
aim[j]
=
=
0
:
out
+
=
index_t[get[j]
-
1
]
cout
+
=
1
out
+
=
str
(
9
-
cout)
print
(out)
print
(
len
(out))
垃圾题。想了好久,最后脑洞出来了。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK