본문 바로가기 메뉴 바로가기

jenlog

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

jenlog

검색하기 폼
  • All (81)
    • algorithm (71)
      • baekjoon (31)
      • swea (30)
      • programmers (9)
    • JS (1)
    • Vue.js (2)
    • React (2)
    • * etc (5)
  • 방명록

1961 숫자 배열 회전 (1)
[swea] 1961. 숫자 배열 회전 / python 파이썬

코드 ❕ 주의 ❕ 90도 회전하는 rotation 함수에서 먼저 NxN 빈 배열을 만들어줘야 한다. 그래야 회전한 값을 넣을 수 있다. T = int(input()) # 90도 회전하는 함수 def rotation(a, N): new_arr = [[0] * N for _ in range(N)] # NxN 빈 배열 먼저 만들기 for i in range(N): for j in range(N): new_arr[i][j] = a[N-1-j][i] return new_arr for tc in range(1, T+1): N = int(input()) arr = [list(map(int, input().split())) for _ in range(N)] rot_90 = rotation(arr, N) rot_180 ..

algorithm/swea 2021. 4. 9. 00:34
이전 1 다음
이전 다음
글 보관함
TAG
  • dp
  • 21609 상어 중학교
  • 파이썬
  • swea
  • 17406 배열돌리기4
  • 백준
  • 삼성기출
  • 브루트포스
  • dfs
  • 2579 계단오르기
  • BFS
  • merge에러
  • 삼성코테
  • 알고리즘
  • 20056 마법사 상어와 파이어볼
  • Python
  • react
  • git 미러링
  • 2018 카카오 공채
  • 20057 마법사 상어와 토네이도
  • 프로그래머스
  • 보석쇼핑
  • 기지국설치
  • 영어끝말잇기
  • merge 에러
more
최근에 올라온 글
Total
Today
Yesterday
최근에 달린 댓글
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

jennnn.tistory.com

티스토리툴바