# # Q 1508 HARD Q
# n = int(input())
# biglist = []
# point = 0
# right = 0
# up = 0
# for i in range(n):
# zeros = [0] * (i+1) # makes a 0 list in pyramid shape
# biglist.append(zeros)
# for i in range(n):
# x = int(input())
# biglist[i][0] = x # first value is inputted
# for i in range(1, n):
# for j in range(1, len(biglist[i])): # because if it's just n, it will look over the pyramid as a box and will be out of range
# biglist[i][j] = biglist[i][j-1] - biglist[i-1][j-1] # the current value will be the one on the right - the one on the top of the right
# for i in range(n):
# for j in range(len(biglist[i])):
# print(biglist[i][j], sep='', end=' ') # this is to print values without the [,] list things
# print()
# # Q 1509 HARD Q
# board = []
# life = 0
# for i in range(11):
# line = list(map(int, input().split()))
# board.append(line) # make the board according to input (11 lines)
# for k in range(10): # k is horizontal
# if board[10][k] == 1: # see if the horse is there (only print if there is a horse in the line)
# for j in range(10):
# if board[j][k] != 0: # saved the last value of the line instead of going from the bottom (right example is in green below)
# life = board[j][k]
# """
# should've been:
#
# for j in range(9, -1, -1):
# life = board[j][k]
#
# because we need to go from the bottom and see obstacles
# """
# if life < 0:
# print(k+1, 'fall')
# elif life > 0:
# print(k+1, 'crash')
# elif life == 0:
# print(k+1, 'safe')
# life = 0
#
# # Q 1512 super confusing
# n = int(input())
# x, y = map(int, input().split())
# x -= 1
# y -= 1
# for i in range(n):
# for j in range(n):
# px = 0
# py = 0
# if x > i: # every step below is to calculate 절대값 to add onto (bc no minus on the map)
# px = x - i
# else:
# px = i - x
#
# if y > j:
# py = y - j
# else:
# py = j - y
# print(px + py + 1, end=' ') # instead of making an entire list, just print one number each into the shape of a table
# print()
# Q 1512 my version - entirely wrong (i could fix it but idk how)
# if i>x-1:
# if j>y-1:
# jido[i][j] = 1 + (i-x-1) + (j-y-1)
# else:
# jido[i][j] = 1 + (i-x-1) + (y-1-j)
# else:
# if j>y-1:
# jido[i][j] = 1 + (x-1-i) + (j-y-1)
# else:
# jido[i][j] = 1 + (x-1-i) + (y-1-j)
# Q 1505 - HOMEWORK !!! AT HOME!!
n = int(input())
snail = []
for i in range(n):
row = [0] * n
snail.append(row)
direction = [[0, 1], [1, 0], [0, -1], [-1, 0]]
"""값넣을때 단일반복문이면 된다"""
for i in range(n*n):
snail[][] =
for i in range(n):
for j in range(n):
print(snail[i][j], end=' ')
print()
# definitely wrong
# for i in range(n):
# snail[0][i] = i + 1
# nextone = snail[0][n-1]
# for i in range(n):
# snail[i][n-1] = nextone + i
# nexttwo = snail[n-1][n-1]
# for i in range(n-1,-1, -1):
# snail[n-1][i] = nexttwo + i
# nextthree = snail[n-1][0]
# for i in range(n-2, 1, -1):
# snail[i][0] = nextthree + i
# for i in range(n-1):
# for j in range(n-1):
# print(snail[i][j])top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
20240421
20240421
댓글 0개
좋아요
댓글(0)
더 이상 게시물에 대한 댓글 기능이 지원되지 않습니다. 자세한 사항은 사이트 소유자에게 문의하세요.
bottom of page


