17 lines
408 B
Python
17 lines
408 B
Python
#!/usr/bin/env python3
|
|
import numpy as np
|
|
|
|
lines = (x.strip() for x in open("input.txt"))
|
|
cnt = 0
|
|
matches = 0
|
|
cubes = set()
|
|
|
|
for line in lines:
|
|
x, y, z = map(int, line.split(","))
|
|
matches += sum((x+nx*s, y+ny*s, z+nz*s) in cubes for s in (1, -1) for nx, ny, nz in ((1, 0, 0), (0, 1, 0), (0, 0, 1)))
|
|
cnt += 1
|
|
cubes.add((x, y, z))
|
|
|
|
print(matches, cnt, len(cubes))
|
|
print(len(cubes)*6-matches*2)
|