Skip to content

Commit b0a6abc

Browse files
authored
[김진용] 62차 라이브 코테 제출 (#511)
* 61차 1번 문제풀이 * 61차 2번 문제풀이 * 61차 3번 문제풀이 * 61차 문제 3번 다시 풀기 * 62차 1번 문제풀이 * 62차 2번 문제풀이 * 문제 2 수정
1 parent 07cc95f commit b0a6abc

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

live6/test62/문제1/김진용.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
5+
R, C, Q = map(int, input().split())
6+
7+
picture = []
8+
for _ in range(R):
9+
picture.append(list(map(int, input().split())))
10+
11+
dp = [[0]*(C+1) for _ in range(R+1)]
12+
13+
for i in range(1, R+1):
14+
for j in range(1, C+1):
15+
dp[i][j] = picture[i-1][j-1] + dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1]
16+
17+
for _ in range(Q):
18+
i, j, x, y = map(int, input().split())
19+
20+
result = dp[x][y] - dp[i-1][y] - dp[x][j-1] + dp[i-1][j-1]
21+
print(result//((x-(i-1))*(y-(j-1))))

live6/test62/문제2/김진용.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
n = int(input())
5+
akvo = list(map(int, input().split()))
6+
7+
mistake_s = 0
8+
dp = [0]*(n+1)
9+
for i in range(n):
10+
if akvo[i] < akvo[i-1]:
11+
mistake_s += 1
12+
13+
dp[i] = mistake_s
14+
15+
q = int(input())
16+
17+
for _ in range(q):
18+
x, y = map(int, input().split())
19+
20+
print(dp[y-1] - dp[x-1])

live6/test62/문제3/김진용.py

Whitespace-only changes.

0 commit comments

Comments
 (0)