Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
79357 彭士宝 矩阵右移动 Python3 Wrong Answer 32 MS 3776 KB 392 2024-07-03 22:01:15

Tests(0/2):


Code:

def right_shift_matrix(m, n, matrix): for _ in range(m): matrix = [row[1:] + [row[0]] for row in matrix] return matrix m, n = map(int, input().split()) matrix = [] for _ in range(n): row = list(map(int, input().split())) matrix.append(row) shifted_matrix = right_shift_matrix(m, n, matrix) for row in shifted_matrix: print(' '.join(map(str, row)))


Run Info:

------Input------
2 3 1 2 3 4 5 6 7 8 9
------Answer-----
2 3 1 5 6 4 8 9 7
------Your output-----
3 1 2 6 4 5 9 7 8