Example Input 2 2 2 4 0 0 0 1 1 0 1 0 1 0 1 1 Output 4
- User
Example Input
2 2 2 4 0 0 0 1 1 0 1 0 1 0 1 1
Output
4
Assistant
pythonimport itertools # Read input d = list(map(int, input().split())) m = int(input()) points = set(tuple(map(int, input().split())) for _ in range(m)) count = 0 # Generate all possible hypercube base points dim_ranges = [range(di) for di in d] for x_comb in itertools.product(*dim_ranges): # Generate all points of the hypercube required = list(itertools.product(*[(x, x+1) for x in x_comb])) if all(pt in points for pt in required): count += 1 print(count)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.