Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 정보보호 영재원
- boj
- 5086
- 2605
- 리뷰
- 2965
- 차세대 보안 리더 양성 프로그램
- 2476
- 정보보호 영재교육원
- Python
- BOB
- 차세대 보안 리더 양성
- 11943
- 5586
- 10833
- 4101
- text
- 2506
- BoB 7기
- 1547
- 10995
- Best of the Best
- EOF
- BoB 후기
- 영재원
- 2501
- 공주대 정보보호
- acmicpc
- 영재교육원
- 11109
Archives
- Today
- Total
짱해커가 되어보자
boj 2167 본문
* Solved 기준 브론즈2 단순 풀이
n,m = map(int, input().split())
dp,l = [[0]*(m+1) for _ in range(n+1)], [list(map(int,input().split())) for _ in range(n)]
for i in range(1,n+1):
for j in range(1,m+1):
dp[i][j] = l[i-1][j-1] + dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1]
for _ in range(int(input())):
i,j,x,y = map(int, input().split())
print(dp[x][y] - dp[x][j - 1] - dp[i - 1][y] + dp[i - 1][j - 1])
Comments