This repository has been archived on 2022-01-12. You can view files and clone it, but cannot push or open issues or pull requests.
USACO-Demo/lineup.txt
2020-07-25 15:17:26 -05:00

14 lines
375 B
Text

read in N
constraints[N][2]
for i from 1 to N:
read in constraints[i][1] and constraints[i][2]
for every permutation P of [ Bessie, Buttercup, Belinda, Beatrice, Bella, Blue, Betsy, Sue ]:
for i from 1 to N:
bad = false
if the position of constraints[i][1] is NOT next to position of constraints[i][2]
then set bad to true
if NOT bad
then output P