์ „์ฒด ๊ธ€

์ „์ฒด ๊ธ€

    [MySQL] ์ค‘๋ณต๊ฐ’ ์ œ์™ธ(GROUP BY, DISTINCT) | NULL ๊ฐ’ ์ œ์™ธ(IS id NOT NULL)

    ์†Œํ”„ํŠธ์›จ์–ด ๋งˆ์—์ŠคํŠธ๋กœ ์ฝ”๋”ฉํ…Œ์ŠคํŠธ์— ๋Œ€๋น„ํ•˜๊ธฐ ์œ„ํ•ด์„œ Programmers SQL ๊ณ ๋“์  Kit๋ฅผ ๊ณต๋ถ€ํ•˜๊ฒŒ ๋์Šต๋‹ˆ๋‹ค. ์ƒˆ๋กœ ์•Œ๊ฒŒ ๋œ, ๊นŒ๋จน์—ˆ๋˜ ๋ฌธ๋ฒ•์„ ์ •๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ๋ฌธ์ œ ๊ธฐ๋ฐ˜์œผ๋กœ ์ •๋ฆฌํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค~ ๊ทธ๋Ÿผ ์„œ๋ก ์€ ์ด์ฏค๊นŒ์ง€ ํ•˜๊ณ  ์ œ๋ชฉ์„ ๋ณด๊ณ  ๋“ค์–ด์˜ค์‹  ๋ถ„๊ป˜ ๋„์›€์ด ๋  ๋ฌธ์ œ๋ฅผ ๊ณต๊ฐœํ•ฉ๋‹ˆ๋‹ค! '์ค‘๋ณต ์ œ๊ฑฐํ•˜๊ธฐ' ํ•ด๋‹น ๊ธ€์—์„œ๋Š” ๋ฌธ์ œํ’€์ด ๊ณต๊ฐ„์ด ์•„๋‹ˆ๊ณ  ๊ฐœ๋… ์ •๋ฆฌ๋ฅผ ์ง„ํ–‰ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค ๋‹ค์Œ ๋‘ ๊ฐœ ๋งํฌ๋ฅผ ํ†ตํ•ด ๋ฌธ์ œ๋ฅผ ํ’€์–ด๋ณด์‹œ๊ณ  ํ’€์ด๊นŒ์ง€ ๋ณด์‹œ๋Š” ๊ฒƒ์„ ์ถ”์ฒœ๋“œ๋ฆฝ๋‹ˆ๋‹ค! [๋ฌธ์ œ ํ’€์–ด๋ณด๊ธฐ] https://school.programmers.co.kr/learn/courses/30/lessons/59408 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ..

    [Python] ๋ฐฑ์ค€ 2563 ์ƒ‰์ข…์ด

    ์†Œ๋งˆ ์ฝ”ํ…Œ๋ฅผ ์ฒ˜์Œ ์ค€๋น„ํ•˜๋˜ ๋•Œ ํ’€์ดํ–ˆ๋˜ ๊ฒƒ์ธ๋ฐ ์ •๋ง ์–ด๋–ป๊ฒŒ ํ’€๊ณ ์‹ถ์—ˆ๋˜๊ฑด์ง€ ๊ฐ์ด ์•ˆ ์žกํžŒ๋‹ค..ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ ์ฒ˜์Œ ์‹œ๋„ํ•œ ๋ฐฉ์‹์˜ ํ’€์ด๋Š” ๋‹ค์Œ ๊ฐ™๋‹ค. [์‹คํŒจํ•œ ์ฝ”๋“œ] paper = int(input()) papers = [[0]*paper for i in range(paper)] result = 0 x = 0 y = 0 for i in range(paper): papers[i] = list(map(int, input().split())) for i in range(paper): for j in range(i+1, paper): if papers[i][0] < papers[j][0] < papers[i][0] + 10: x = papers[i][0] + 10 - papers[j][0] if papers[i][1] ..

    [Python] 1783 ๋ณ‘๋“  ๋‚˜์ดํŠธ | ๊ทธ๋ฆฌ๋”” ์•Œ๊ณ ๋ฆฌ์ฆ˜

    ~์‹ค๋ฒ„ 3~ https://www.acmicpc.net/problem/1783 1783๋ฒˆ: ๋ณ‘๋“  ๋‚˜์ดํŠธ ์ฒซ์งธ ์ค„์— ์ฒด์ŠคํŒ์˜ ์„ธ๋กœ ๊ธธ์ด N์™€ ๊ฐ€๋กœ ๊ธธ์ด M์ด ์ฃผ์–ด์ง„๋‹ค. N๊ณผ M์€ 2,000,000,000๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ž์—ฐ์ˆ˜์ด๋‹ค. www.acmicpc.net [๋ฌธ์ œ ํ•ด๊ฒฐ ํฌ์ธํŠธ] 1. ์ œํ•œ ์‚ฌํ•ญ์„ ๋‹จ๊ณ„์ ์œผ๋กœ ๋ถ„๋ฆฌํ•˜๊ธฐ 2. n์˜ ์ œํ•œ ์‚ฌํ•ญ ์ดํ•ดํ•˜๊ธฐ 3. m์˜ ์ œํ•œ ์‚ฌํ•ญ ์ดํ•ดํ•˜๊ธฐ 1. ์ œํ•œ ์‚ฌํ•ญ์„ ๋‹จ๊ณ„์ ์œผ๋กœ ๋ถ„๋ฆฌํ•˜๊ธฐ ์ฒ˜์Œ์— ๋ฌธ์ œ๋ฅผ ์ฝ์œผ๋ฉด '... ๋ญ ์–ด์ฉŒ๋ผ๋Š” ๊ฑฐ์•ผ' ํ˜น์€ '์ด๊ฑธ ์–ด๋–ป๊ฒŒ ํ’€๋ผ๋Š” ๊ฑฐ์•ผ'๋ผ๋Š” ์ƒ๊ฐ์„ ํ• ์ง€๋„ ๋ชจ๋ฅธ๋‹ค ๋‚ด๊ฐ€ ๊ทธ๋žฌ๋‹ค ๋‹ค์‹œ ํ•œ๋ฒˆ ๋ฌธ์ œ๋ฅผ ์ฐฌ์ฐฌํžˆ ์‚ดํŽด๋ณด๊ณ  ์ œํ•œ ์‚ฌํ•ญ์„ ๊ผผ๊ผผํžˆ ์‚ดํŽด๋ณด๋ฉฐ์นจ์ฐฉํ•˜๊ฒŒ ์ƒ๊ฐํ•ด ๋ณผ ํ•„์š”๊ฐ€ ์žˆ๋‹ค. ๋ชจ๋“  ์‹œ์ž‘ ์œ„์น˜๋Š” (0, 0)์ด๋ผ๊ณ  ๊ฐ€์ •ํ•œ๋‹ค. ์ž…๋ ฅ์œผ๋กœ ์ฃผ์–ด์ง€๋Š” n๊ณผ m์˜ ํฌ๊ธฐ..

    [Python | week1-4] ๊ทธ๋ฆฌ๋”” ์•Œ๊ณ ๋ฆฌ์ฆ˜(Greedy Algorithm) |

    week 1-4 1-1๋ถ€ํ„ฐ ํ˜„์žฌ ๊ธ€(1-4)๊นŒ์ง€ ๋งค๋ฒˆ ์ž‘์„ฑํ•œ ๊ธ€์€ 4์ฃผ์ฐจ, ์ฆ‰ week 4๊นŒ์ง€ ์ž‘์„ฑ ๋  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค School ์—์„œ ์ง„ํ–‰ํ•˜๋Š” ์ฝ”ํ…Œ ์ค€๋น„ ๊ฐ•์˜๋กœ ๋ณธ ๊ณผ์ •์„ ๋”์šฑ ๊นŠ์ด ์ดํ•ดํ•˜๊ธฐ ์œ„ํ•ด์„œ ์Šค์Šค๋กœ ์ž‘์„ฑํ•˜๋Š” ์‹œ๋ฆฌ์ฆˆ์ž…๋‹ˆ๋‹ค week1-2 ์—์„œ ํ•™์Šตํ•œ ๊ทธ๋ฆฌ๋”” ์•Œ๊ณ ๋ฆฌ์ฆ˜์ด ๋˜ ๋‹ค์‹œ ๋“ฑ์žฅํ–ˆ์Šต๋‹ˆ๋‹ค! 2023.01.13 - [๐Ÿ“‚Language/Python] - [Python | week1-2] Greedy ์•Œ๊ณ ๋ฆฌ์ฆ˜ | ์ด๊ฒƒ์ด ์ฝ”๋”ฉํ…Œ์ŠคํŠธ๋‹ค [Python | week1-2] Greedy ์•Œ๊ณ ๋ฆฌ์ฆ˜ | ์ด๊ฒƒ์ด ์ฝ”๋”ฉํ…Œ์ŠคํŠธ๋‹ค week1-2 [์˜ค๋Š˜์˜ ํ•™์Šต] 1. Greedy ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ฐœ๋… 2. '์ฒด์œก๋ณต' ๋ฌธ์ œ ํ’€์ด 3. ๊ทธ๋ฆฌ๋”” ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ถ”์ฒœ ํ•™์Šต 1. Greedy Algorithm ๊ฐœ๋… ์ด๋ฆ„๊ณผ ๊ฐ™์ด ํƒ์š•์Šค๋Ÿฌ์šด ..