# # 1409
# numbers = list(map(int, input().split()))
# x = int(input())
# print(numbers[x-1])
# # 1410
# gwalho = input()
# left = gwalho.count("(")
# right = gwalho.count(")")
# print(left, right, sep=' ')
# # 1425
# n, c = map(int, input().split())
# seating = []
# heights = list(map(int, input().split()))
# heights.sort()
# for i in range(n):
# print(heights[i], end=' ')
# if i % (c-1) == 0 and i != 0:
# print()
# # 1430
# n = int(input())
# numbers = list(map(int, input().split()))
# m = int(input())
# questions = list(map(int, input().split()))
# for i in range(m):
# x = questions[i]
# if numbers.count(x) == 0:
# print('0', end=' ')
# else:
# print('1', end=' ')
top of page
기능을 테스트하려면 라이브 사이트로 이동하세요.
20240623 python restart
20240623 python restart
댓글 2개
좋아요
댓글(2)
bottom of page
unsolved Q
# 1510 n = int(input()) square = [] numbers = [] x = 0 y = n//2 k = 1 for i in range(n): zero = [0] * n square.append(zero) square[x][y] = k k += 1 for i in range(3): # insert "n*n-1" x -= 1 y += 1 # for normal cases if x < 0: x = n - 1 if y >= n: y = 0 # if x and y get out of limits square[x][y] = k k += 1 # number increases from 2 -> n*n if k-1 % n == 0: x += 1 # above is the weird lines of code to fix. idk where to put them either for i in range(n): for j in range(n): print(square[i][j], end=' ') print()