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

14 lines
375 B
Text
Raw Normal View History

2020-07-25 20:17:26 +00:00
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
2020-07-11 23:09:51 +00:00
then output P