-
Notifications
You must be signed in to change notification settings - Fork 0
/
# 백준 단계별로 풀어보기 7.py
65 lines (53 loc) · 1.21 KB
/
# 백준 단계별로 풀어보기 7.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 백준 단계별로 풀어보기 7
# 2738번
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(n)]
b = [list(map(int,input().split())) for _ in range(n)]
for i in range(n):
for j in range(m):
a[i][j] += b[i][j]
for i in a:
print(*i)
#2566번
n_list = []
for i in range(9):
n = list(map(int,input().split()))
n_max = max(n)
n_idx = n.index(n_max)
n_tmp = []
n_tmp.append(n_max)
n_tmp.append(i+1)
n_tmp.append(n_idx+1)
n_list.append(n_tmp)
max_list = max(n_list)
print(max_list[0])
print(max_list[1], max_list[2])
#10798번
n_list = []
for i in range(15):
n_list.append([])
for i in range(5):
n = list(input())
p = 0
for j in n:
n_list[p].append(j)
p +=1
result = ''
for i in range(len(n_list)):
res = ''.join(str(s) for s in n_list[i])
result += res
print(result)
#2563번
n_list = [[0 for _ in range(101)] for _ in range(101)]
n = int(input())
for _ in range(n):
x,y = list(map(int,input().split()))
for r in range(x,x+10):
for c in range(y, y+10):
n_list[r][c] = 1
result = 0
for i in n_list:
result += i.count(1)
print(result)