Skip to content
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

[python] #298 solve boj1003 #301

Merged
merged 2 commits into from
Jun 10, 2023
Merged

[python] #298 solve boj1003 #301

merged 2 commits into from
Jun 10, 2023

Conversation

minjae9610
Copy link
Member

๐Ÿ“ฃ Related Issue

close #298

๐ŸŒ Background

์ผ์ผ ๋ชฉํ‘œ ๋‹ฌ์„ฑ

๐Ÿ‘ฉโ€๐Ÿ’ป Contents

BoJ 1003 ํ”ผ๋ณด๋‚˜์น˜ ํ•จ์ˆ˜

image
image

import sys

T, *testcases = map(int, sys.stdin.read().splitlines())

result = []
for testcase in testcases:
    zero_count, one_count = 1, 0
    for _ in range(testcase):
        zero_count, one_count = one_count, zero_count + one_count
    result.append('{} {}'.format(zero_count, one_count))

sys.stdout.write('\n'.join(result))

๐Ÿ“ฑ Screenshot

image

๐Ÿ“ Review Note

DP๋ฌธ์ œ์˜ ๋Œ€ํ‘œ์ธ ํ”ผ๋ณด๋‚˜์น˜ ํ•จ์ˆ˜ ๋ฌธ์ œ๋ฅผ ์‚ด์ง ๊ผฌ์•„๋‘” ๋ฌธ์ œ๋‹ค.
์ •์„์ ์ธ ์žฌ๊ท€๋ฐฉ๋ฒ•์„ ์ด์šฉํ•ด ํ”ผ๋ณด๋‚˜์น˜ ๊ฒฐ๊ณผ๋ฅผ ์–ป์–ด๋‚ด๋ ค๋ฉด ์‹œ๊ฐ„์ด ์˜ค๋ž˜ ๊ฑธ๋ฆฌ๊ธฐ ๋•Œ๋ฌธ์— 0, 1๋ถ€ํ„ฐ ์—ญ์ˆœ์œผ๋กœ ๊ณ„์‚ฐํ•ด ์˜ฌ๋ผ๊ฐ€๋ฉด ๋น ๋ฅด๊ฒŒ ์—ฐ์‚ฐํ•  ์ˆ˜ ์žˆ๋‹ค.

๐Ÿ“ฌ Reference

@minjae9610 minjae9610 added the ์ผ์ผ ๋ชฉํ‘œ ๋‹ฌ์„ฑ ์ผ์ผ ๋ชฉํ‘œ ๋ฌธ์ œ๋ฅผ ์ „๋ถ€ ๋‹ฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค label Jun 6, 2023
@minjae9610 minjae9610 added this to the Week16 milestone Jun 6, 2023
@minjae9610 minjae9610 requested a review from a team as a code owner June 6, 2023 09:40
@minjae9610 minjae9610 requested review from cryscham123 and whyNot077 and removed request for a team June 6, 2023 09:40
Copy link

@whyNot077 whyNot077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@cryscham123 cryscham123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฝ”๋“œ ์ž˜ ๋ดค์Šต๋‹ˆ๋‹ค. LGTM!

@minjae9610 minjae9610 merged commit 7662834 into main Jun 10, 2023
@minjae9610 minjae9610 deleted the algo/minjae9610/2023-06-05 branch June 10, 2023 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
์ผ์ผ ๋ชฉํ‘œ ๋‹ฌ์„ฑ ์ผ์ผ ๋ชฉํ‘œ ๋ฌธ์ œ๋ฅผ ์ „๋ถ€ ๋‹ฌ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2023-06-05 ~ 2023-06-06
3 participants