fork download
  1. # Positions for the hours hand, 0 though 43199
  2. hours = range(0,43200)
  3. # The minute hand moves 12 positions per second
  4. minutes = [i*12%43200 for i in hours]
  5. # Create a list of (hour position, minute position)
  6. positions = zip(hours, minutes)
  7. ans=0
  8. for position in positions:
  9. # Flip this instance around
  10. flipped = (position[1], position[0])
  11. # Check if the flipped version is also present
  12. if flipped in positions:
  13. print ("Values: %s, %s" % (str(position[0]), str(position[1])))
  14. print ("Present in both orientations.\n")
  15. ans+=1
  16. print("ans is : %d" % (ans))
Success #stdin #stdout 0.04s 9984KB
stdin
Standard input is empty
stdout
ans is : 0