We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://www.acmicpc.net/problem/2851
문제의 핵심을 요약한다. 체계적인 문제 접근을 위해, 문제를 추상화한다
적합한 자료구조를 생각한다
# 1 --- # 2 --- # 3
추상화한 문제 이해를 기반으로 알고리즘의 대략적인 구현 계획을 서술한다
idea를 수도 코드로 작성해본다
curr = 0 loop i in 0...10-1: if abs(100 - curr) > abs(100 - curr - nums[i]) or equal and next one is bigger curr += nums[i] else break print curr
알고리즘의 유효 여부를 구현 전에 검증한다
예제 입력을 수도 코드로 계산해보고, 놓친 알고리즘 오류가 있는지 확인한다
import sys readl = sys.stdin.readline nums = [int(readl()) for _ in range(10)] def f(): curr = 0 for i in range(10): nextt = curr + nums[i] curr_diff = abs(100 - curr) next_diff = abs(100 - nextt) if curr_diff > next_diff or (curr_diff == next_diff and nextt > curr): curr = nextt else: break print(curr) f()
브론즈 단순 요구사항 구현 문제
next one is bigger ->
curr + nums[i] > curr
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem link
https://www.acmicpc.net/problem/2851
Problem abstraction
Design(Plan) algorithm
Algorithm idea
Pseudo-code
Validate algorithm
Impl
Self-feedback
구조적 접근: 문제를 추상화하여 구조적으로 접근했는가?
브론즈 단순 요구사항 구현 문제
사고력: 알고리즘을 완전히 이해했는가? (충분한 사고력을 가졌는가?)
구현력: 알고리즘을 신속, 정확하게 구현했는가?
next one is bigger ->
The text was updated successfully, but these errors were encountered: