Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

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