Last active
October 14, 2018 07:49
-
-
Save bohyunjung/9fae7d88bd20284b53bd733783723c1f to your computer and use it in GitHub Desktop.
pycon 한국 2018 래블업 코드골프 제출 코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=int(input()) | |
m=int(input()) | |
l="-" | |
z=n+2 | |
q=1<<z | |
for i in range(n): | |
a=n-i if i>n/2-1 else i+1 | |
b=abs(n-2*i) | |
b+=(b==0)+a | |
q^=(1<<a|1<<b) | |
x=y="" | |
for j in range(1,z): | |
x+=" +"if j==a else l*4 if a<j and j<b else l*3+"+" if j==b else" |" | |
y+=" |"if q&1<<j else" " | |
print(x*m+'\n'+y*m) | |
print(((4*i+3)*l+"+ +")*m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment