scripts/ege/13022023/8.py
2023-05-05 00:45:01 +03:00

25 lines
708 B
Python
Vendored
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

alf = "ЕКОФ"
sgl = "КФ"
r = []
n = 1
for a in alf:
for b in alf:
for c in alf:
for d in alf:
for e in alf:
w = a + b + c + d + e
if w.count("О") == 1:
i = w.index("О")
if i == 0:
f = w[i + 1] not in sgl
elif i == 4:
f = w[i - 1] not in sgl
else:
f = w[i + 1] not in sgl and w[i - 1] not in sgl
if f:
r.append(n)
n += 1
print(min(r) + max(r))