1961-回転数配列複写
問題の説明
リンク
問題を解く
lotaion前後i,jに関するルールを探します.
各LOTAION 90度は上記のタスクを完了する first,second,thirdはそれぞれ90180,270度回転した結果配列を入れる. zip内蔵関数印刷出力. コード#コード#
リンク
問題を解く
lotaion前後i,jに関するルールを探します.
各LOTAION 90度は
after[i][j] = before[j][len(after) - i - 1]
の規則性を有する.lotaion
関数を作成します.T = int(input())
for tc in range(1, T+1):
N = int(input())
arr = [list(input().split()) for _ in range(N)]
firstLotation = [[0] * N for _ in range(N)]
secondLotation = [[0] * N for _ in range(N)]
thirdLotation = [[0] * N for _ in range(N)]
firstLotation = lotation(arr, N)
secondLotation = lotation(firstLotation, N)
thirdLotation = lotation(secondLotation, N)
print(f'#{tc}')
for first, second, third in zip(firstLotation, secondLotation, thirdLotation):
print(f'{"".join(map(str, first))} {"".join(map(str, second))} {"".join(map(str,third))}')
Reference
この問題について(1961-回転数配列複写), 我々は、より多くの情報をここで見つけました https://velog.io/@singco/1961-숫자배열회전テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol