Table of Contents

ExplanationImplementation

Official Analysis (Java)

with open("balancing.in") as read:
# max_pos won't be used
cow_num, max_pos = [int(i) for i in read.readline().split()]
x_vals = []
y_vals = []
v_fence = set()
h_fence = set()
for _ in range(cow_num):
x, y = [int(i) for i in read.readline().split()]

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!