반응형 백준알고리즘/2차원 리스트3 (Python/🥈5)색종이 출처:https://www.acmicpc.net/problem/2563 문제 풀이: N = int(input()) # 가로세로 100 짜리 만들어줌 board = [[0] * 101 for i in range(101)] for i in range(N): # 한 줄 받아옴 x, y = map(int,input().split(' ')) # 가로 10 for j in range(10): # 세로10 for z in range(10): # 색칠해주는중 board[x+j][y+z] = 1 res = 0 # 보드판 1 갯수 세서 for i in board: res += i.count(1) # 정답 출력 print(res) 2022. 11. 11. (Python/🥉2)최댓값 문제 출처:https://www.acmicpc.net/problem/2566 문제 풀이: lst = [] for i in range(9): lst.append(list(map(int,input().split()))) max = lst[0][0] x = 1 y = 1 for i in range(9): for j in range(9): if lst[i][j] > max: max = lst[i][j] x = i+1 y = j+1 print(max) print(x,y) 2022. 11. 11. (Python/🥉5)행렬의 덧셈 문제 출처:https://www.acmicpc.net/problem/2738 2738번: 행렬 덧셈 첫째 줄에 행렬의 크기 N 과 M이 주어진다. 둘째 줄부터 N개의 줄에 행렬 A의 원소 M개가 차례대로 주어진다. 이어서 N개의 줄에 행렬 B의 원소 M개가 차례대로 주어진다. N과 M은 100보다 작거나 같 www.acmicpc.net 문제 풀이: N,M = map(int,(input().split(' '))) list_2 = [] for i in range(N): list_2.append(list(map(int,input().split(' ')))) for i in range(N): plus = list(map(int,input().split(' '))) for j in range(M): list_2[.. 2022. 11. 9. 이전 1 다음 반응형