A09 - Winter in ALGO Kingdom
https://atcoder.jp/contests/tessoku-book/tasks/tessoku_book_i
提出
code: python
h, w, n = map(int, input().split())
abcd = list(map(int, input().split())) for _ in range(n)
# print(abcd)
# 1, 1, 3, 3], [2, 2, 4, 4
z = [0 * (w+1) for _ in range(h+1)]
# O(N*H*W)
for a, b, c, d in abcd:
for i in range(a, c+1):
for j in range(b, d*1):
pass
解答
code: python
h, w, n = map(int, input().split())
abcd = list(map(int, input().split())) for _ in range(n)
x = [0 * (w + 2) for _ in range(h + 2) ]
# 各日について加算
for a, b, c, d in abcd:
xab += 1
xad+1 -= 1
xc+1b -= 1
xc+1d+1 += 1
z = [0 * (w + 2) for _ in range(h + 2)]
for i in range(1, h+1):
for j in range(1, w+1):
zij = zij-1 + xij
for j in range(1, w+1):
for i in range(1, h+1):
zij = zi-1j + zij
for i in range(1, h+1):
for j in range(1, w+1):
if j >= 2:
print(" ", end="")
print(zij, end="")
print("")
提出
code: python
h, w, n = map(int, input().split())
abcd = list(map(int, input().split())) for _ in range(n)
# 縦、横の累積話
# waij: 上からi, 左からj までの累積和
wa = [0 * w for _ in range(h)]
# 前日比