-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask090.py
More file actions
14 lines (13 loc) · 899 Bytes
/
task090.py
File metadata and controls
14 lines (13 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# best: 147(Code Golf International) / others: 153(ox jam), 158(jailctf merger), 159(4atj sisyphus luke Seek mukundan), 175(lv1.dev), 180(santa2024)
# ====================================================================== 147 ======================================================================
def p(g):
# _,l,r,t=max(((d-u)*(r-l)-9*sum(sum([*zip(*g[u:d])][l:r],())),l,r,g[u:d])for d in range(len(g)+1)for r in range(len(g[0])+1)for u in range(d-1)for l in range(r))
_,l,r,t=max(((d-u)*(r-l)-9*sum(sum(s[l:r])for s in g[u:d]),l,r,g[u:d])for d in range(len(g)+1)for r in range(len(g[0])+1)for u in range(d-1)for l in range(r))
for s in t:
s[l:r]=[6]*(r-l)
return g
# def p(g):
# _,_,l,r,t=max((-sum(sum([*zip(*g[u:d])][l:r],())),(d-u)*(r-l),l,r,g[u:d])for d in range(len(g)+1)for r in range(len(g[0])+1)for u in range(d-1)for l in range(r))
# for s in t:
# s[l:r]=[6]*(r-l)
# return g