반응형
생각보다 오래걸렸다..
# http://www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id=1129&sca=2010
inputValue = input()
x = int(inputValue.split(' ')[0])
y = int(inputValue.split(' ')[1])
count = 0
for idx in range(1, x+1):
for sub_idx in range(1, y+1):
if idx % 2 == 0:
count -= 1
print(count, end=" ")
else:
count += 1
print(count, end=" ")
if idx % 2 == 1:
count = count + y + 1
else:
count = count + y - 1
print("")
반응형
'개발문제해결 > 알고리즘 문제풀이' 카테고리의 다른 글
백준 11399 - ATM python3 (0) | 2020.08.08 |
---|---|
정올 알고리즘 - 1341 : 구구단2 python3 (1) | 2020.06.28 |
백준 10866 - 덱 (0) | 2018.05.07 |