fork download
  1. # http://c...content-available-to-author-only...e.com/a/85196/34718
  2.  
  3. def f(s):
  4. s=s.split("\n");e=l=0;h=len(s);w=len(s[0])
  5. for c in s[0][1:-1]+s[-1][1:-1]:
  6. if(c in"#-")<1:return 0
  7. if"-"==c:e=1
  8. for r in s[1:-1]:
  9. if(r[0]in"#|")*(r[-1]in"#|")<1or" "*5in r:return 0
  10. if"$"in r:l=1
  11. for r in zip(*s):
  12. if" "*5in`r`[2::5]:return 0
  13. if(h*w<60)+(h*w>749)+(w<5)+(h<4)or" "in s[0][0]+s[0][-1]+s[-1][0]+s[-1][-1]or("T"in s[-2])*("C"in s[-2])*l<1or("#"in s[-1][2:-2])<1or"|"in"".join(s[1:-1])<1>e:return 0
  14. return 1
  15.  
  16.  
  17. s = """
  18. -####-#####|
  19. #* *** *#
  20. #* $ *#
  21. #**** *** *#
  22. #**T***C* *|
  23. ##-------###"""
  24.  
  25. print f(s[1:])
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
1