Skip to content

BOJ15724_주지수_실버1_조재은#44

Open
jojaegu2 wants to merge 2 commits intomainfrom
BOJ15724_조재은

Hidden character warning

The head ref may contain hidden characters: "BOJ15724_\uc870\uc7ac\uc740"
Open

BOJ15724_주지수_실버1_조재은#44
jojaegu2 wants to merge 2 commits intomainfrom
BOJ15724_조재은

Conversation

@jojaegu2
Copy link
Collaborator

💡 예제 입력
4 4
9 14 29 7
1 31 6 13
21 26 40 16
8 38 11 23
3
1 1 3 2
1 1 1 4
1 1 4 4

💡 Solution
9 14 29 7 → 9 14 29 7
1 31 6 13 → 10 45 35 20
21 26 40 16 → 31 71 75 36
8 38 11 23 → 39 109 86 59

열별로 합을 누적시킨다. 마지막 줄의 39가 첫 열의 합, 109는 둘째 열의 합, 59는 넷째열의 합이 된다
1 1 3 2 (입력) → 102 (출력)
1 1 1 4 (입력) → 59 (출력)
2 2 3 4 (입력) → 132 (출력)
3 2 4 4 (입력) → 154 (출력)

image

x1 > 1인경우, 2 2 3 4 를 입력했을 때는 구역이 중간에서 시작한다.
가장 아랫줄의 합에서 시작지점인 2행보다 한 줄위인 1행의 합을 빼줘야 정답이 된다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant