백준 18883번: N M 찍기 #Python

ColorlessDia·2024년 9월 30일

algorithm/baekjoon

목록 보기
316/807
import sys

N, M = map(int, sys.stdin.readline().split())

count = 1

for _ in range(N):
    temp = [0] * M

    for i in range(M):
        temp[i] = count
        count += 1
    
    print(*temp)

0개의 댓글