aoc2024/d25/part1_imp.py

20 lines
483 B
Python
Raw Permalink Normal View History

2024-12-25 23:23:30 +00:00
S = 0
I = open("input").read()
th=2
@par(num_threads=th,chunk_size=500//th)
for i in range(500):
if I[43*i] == '#':
#@par # much slower
for j in range(500):
if I[43*j] == '.':
for k in range(6,37):
if I[43*i+k]=='#' and I[43*j+k]=='#':
break
else:
S += 1
print(S)
# 130ms with cpython
# with codon
# par 1 th: 6ms
# par 2 th: 4ms
# more // is slower