-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask346.py
More file actions
53 lines (46 loc) · 2.33 KB
/
task346.py
File metadata and controls
53 lines (46 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# best: 52(ox jam) / others: 55(jacekw Potatoman nauti natte), 55(Code Golf International), 55(import itertools), 55(intgrah jimboko awu macaque sammyuri), 56(HIMAGINE THE FUTURE.)
# import re;p=lambda g:[[*{*sum(g,[])}-{0,int(re.search(rf"([^0]), \1, \1.{{{len(g[0])*3-5}}}\1, ",str(g))[1])}]]
# import re;p=lambda g:[[int(({*(s:=str(g))}-{*" ,0[]",re.search(rf"([^0]), \1, \1.{{{len(g[0])*3-5}}}\1",s)[1]}).pop())]]
# import re;p=lambda g:[[int(re.search(rf"([^0]), \1, \1.{{{len(g[0])*3-5}}}\1, ((?!\1).)",str(g))[2])]]
# import re;p=lambda g:[[int(re.search(rf"([^0]), \1.{{{len(g[0])*3-5}}}\1, ((?!\1).), \1",str(g))[2])]]
# import re;p=lambda g:[[int(re.search(rf"(, [^0])\1{{2}}.{{{len(g[0])*3-7}}}\1(?!\1), (.)",str(g))[2])]]
# import re;p=lambda g:[[int(re.search(rf"(, [^0])\1{{2}}.{{{len(g[0])*3-7}}}\1(?!\1), .",str(g))[0][-1])]]
# import re;p=lambda g:[[int(re.search(r"(, [^0])\1{2}.{"+str(len(g[0])*3-7)+r"}\1(?!\1), (.)",str(g))[2])]]
# import re;p=lambda g:[[int(re.search(r"(, [^0])\1\1.{%d}\1(?!\1), (.)"%(len(g[0])*3-7),str(g))[2])]]
# ======================= 52 =======================
p=lambda g:[[min(a:=sum(g+g[1:-3:3],g[3]),key=a.count)]]
# g[0:4]*1+g[1:-1]*2
# g[1:-1]*1+g[1:3]*1
# g[1:-1]*1+g[1:4]*1
# g[1:-1]*2+g[2:4]*2
# sum(g+g[1:3]+g[1:],[])
# sum(g+g[1:-3:3],g[3])
# sum(g+g[1:-2:3],g[3])
# from collections import Counter
# from tqdm import tqdm
# from utils import get_cases
# cases = get_cases(346)
# cntr = Counter()
# sorted_cases = sorted(enumerate(cases), key=lambda x: [75, 89, 136, 266, 61, 14, 223, 80, 35, 194, 118, *range(1000)].index(x[0]))
# for i in range(-4,5):
# for j in [0]:
# if i >= j and(i<0>j or i>=0<=j): continue
# print(cntr)
# for k in tqdm(range(-4,5)):
# if k == 0: continue
# for l in range(-4,5):
# for c1 in range(4):
# for c2 in range(4):
# wa = []
# for idx, case in sorted_cases:
# g=case['input']
# ans = case['output'][0][0]
# if ans != min(a:=sum(g+g[i::k]*c1,g[l]*c2),key=a.count):
# wa.append(idx)
# if 2 <= len(wa): continue
# prob = len(wa) / len(cases)
# if prob < 0.01:
# cntr.update(wa)
# print(f"{prob} {wa}: g[{i}:{j}:{k}]*{c1},g[{l}]*{c2}")
# if prob == 0:
# input("> ")