์ „์ฒด ๊ธ€

์ „์ฒด ๊ธ€

    [Python] ๋ฐฑ์ค€ 2609 ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜์™€ ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜

    ๋ธŒ๋ก ์ฆˆ 1 ๋ฌธ์ œ (์ •๋‹ต๋งŒ์ด ์•„๋‹Œ ๊ฐœ์ธ์ ์ธ ํ’€์ด ๊ณผ์ •์„ ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค) ์ฝ”๋“œ๋ฅผ ์„ค๋ช…ํ•˜๊ธฐ ์•ž์„œ ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜์™€ ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜๋ฅผ ์ˆ˜ํ•™์ ์œผ๋กœ ์ดํ•ดํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์™œ ํ•œ ๋ฌธ์ œ์—์„œ ๋‘ ๊ฐœ๋‚˜ ํ’€์–ด์•ผ ๋ผ? ํ•  ์ˆ˜ ์žˆ์œผ๋‚˜ ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜์™€ ์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜๋Š” ์ง๊ฟ์ฒ˜๋Ÿผ ๋‹ค๋‹ ์ˆ˜ ์žˆ๋Š” ์นœ๊ตฌ์ž…๋‹ˆ๋‹ค. ์œ ํด๋ฆฌ๋“œ ํ˜ธ์ œ๋ฒ•์ด๋ผ๋Š” ๋ญ”๊ฐ€ ๋Œ€๋‹จํ•ด ๋ณด์ด๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ํ’€ ์ˆ˜๋„ ์žˆ์ง€๋งŒ ์ €๋Š” ๊ฐœ๋…์„ ์ฐพ์•„๋ณด๊ณ  ์ ์šฉํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ ‘๊ทผํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ฑฐ๋‘์ ˆ๋ฏธํ•˜๊ณ  ์ œ๊ฐ€ ์ฐธ๊ณ ํ•œ ๊ฐœ๋…์„ ๋ณด์‹œ๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ๊ฐœ๋…์„ ํ†ตํ•ด ๋‘ ๊ฐœ์˜ ์ž…๋ ฅ๊ฐ’(a, b)์— ๋Œ€ํ•ด ๋‚˜๋ˆ„์–ด ๋–จ์–ด์ง€๋Š” ๊ฐ’ ์ค‘ ๊ฐ€์žฅ ํฐ ๊ฐ’(์ตœ๋Œ€๊ณต์•ฝ์ˆ˜, gcd)๊ณผ a/์ตœ๋Œ€๊ณต์•ฝ์ˆ˜ * b/์ตœ๋Œ€๊ณต์•ฝ์ˆ˜ * ์ตœ๋Œ€๊ณต์•ฝ์ˆ˜ (์ตœ์†Œ๊ณต๋ฐฐ์ˆ˜, a*b/gcd) ๋„์ถœํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. a, b = list(map(int, input().split())) nu..

    [Python] ๋ฐฑ์ค€ 2566 ์ตœ๋Œ“๊ฐ’ | NameError

    ๊ณผ ๊ฐ™์ด 9×9 ๊ฒฉ์žํŒ์— ์“ฐ์—ฌ์ง„ 81๊ฐœ์˜ ์ž์—ฐ์ˆ˜ ๋˜๋Š” 0์ด ์ฃผ์–ด์งˆ ๋•Œ, ์ด๋“ค ์ค‘ ์ตœ๋Œ“๊ฐ’์„ ์ฐพ๊ณ  ๊ทธ ์ตœ๋Œ“๊ฐ’์ด ๋ช‡ ํ–‰ ๋ช‡ ์—ด์— ์œ„์น˜ํ•œ ์ˆ˜์ธ์ง€ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋‹ค์Œ๊ณผ ๊ฐ™์ด 81๊ฐœ์˜ ์ˆ˜๊ฐ€ ์ฃผ์–ด์ง€๋ฉด ์ด๋“ค ์ค‘ ์ตœ๋Œ“๊ฐ’์€ 90์ด๊ณ , ์ด ๊ฐ’์€ 5ํ–‰ 7์—ด์— ์œ„์น˜ํ•œ๋‹ค. ์ฒ˜์Œ ์ œ์ถœํ•œ ์ฝ”๋“œ๋ฅผ ๋จผ์ € ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. *ํ‹€๋ฆฐ ์ฝ”๋“œ ์ž…๋‹ˆ๋‹ค maxN = 0 row = 0 col = 0 for i in range(9): nlist = list(map(int, input().split())) for j in range(9): if nlist[j] > maxN: maxN = nlist[j] row = i+1 col = j+1 print(maxN) print(row, end=" ") print(col) ๋ฌด์—‡์ด ์ž˜๋ชป ๋˜์—ˆ..

    [Python] ๋ฐฑ์ค€ 10807 ๊ฐœ์ˆ˜์„ธ๊ธฐ

    input() nlist = list(map(int, input().split())) v = int(input()) count = 0 for n in nlist: if v == n: count += 1 print(count) ๋”ฐ๋กœ ์„ค๋ช…์€ ํ•˜์ง€์•Š๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค ๊ถ๊ธˆํ•œ ์ ์ด ์žˆ๋‹ค๋ฉด ๋Œ“๊ธ€ ๋‹ฌ์•„์ฃผ์„ธ์š”!

    Notion Database

    https://sin-young.notion.site/cbf6c7a3f75546f3a19a5f315d7521ea?v=0e0a79c426664e62ba7dfdd25568560e Baekjoon A new tool for teams & individuals that blends everyday work apps into one. sin-young.notion.site ๋ธ”๋กœ๊ทธ์— ์ž‘์„ฑํ•˜์ง€ ์•Š์€ ๋ฌธ์ œ ํ’€์ด๋ฅผ ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ์ฐพ์•„๋ณด์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.