๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ

    [์—๋Ÿฌ/๊นƒํ—ˆ๋ธŒ/์†Œ์ŠคํŠธ๋ฆฌ] ํ‘ธ์‹œ ์—๋Ÿฌ

    1. ์—๋Ÿฌ๋ฌธ git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin master:masterPushing to https://github.com/(๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋งํฌ).gitTo https://github.com/(๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋งํฌ).git ! [rejected] master -> master (fetch first)error: failed to push some refs to 'https://github.com/(๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋งํฌ).git'hint: Updates were rejected because the remote contains work that you dohint: not hav..

    [๋ฐฑ์ค€] 1463๋ฒˆ - 1๋กœ ๋งŒ๋“ค๊ธฐ

    [๋ฐฑ์ค€] 1463๋ฒˆ - 1๋กœ ๋งŒ๋“ค๊ธฐ

    ์—ฌํƒœ๊นŒ์ง€ ๋‚˜๋Š” ์ฝ”๋”ฉ์„ ๊ฐ์œผ๋กœ๋งŒ ๋˜ ๋ง‰ํ’€๊ธฐ๋งŒ ํ•œ ๊ฒƒ ๊ฐ™๋‹ค.DP(Dynamic Programming)์—์„œ ์ œ์ผ ์ค‘์š”ํ•œ ๊ฒƒ์ด ์ ํ™”์‹ ์„ธ์šฐ๊ธฐ๋ผ๋Š” ๊ฒƒ์„ ์ด์ œ์•ผ ์ œ๋Œ€๋กœ ์ดํ•ดํ–ˆ๋‹ค. ๋ฌธ์ œ์˜ ๊ฐ ๊ทœ์น™์„ ๊ณต์‹์œผ๋กœ ๋งŒ๋“ค๊ณ , ์ด๊ฒƒ์„ ํ•˜๋‚˜์˜ ์ˆ˜ํ•™์‹์œผ๋กœ ๋งŒ๋“œ๋Š”๊ฒƒ์ด ์ ํ™”์‹์ด์—ˆ๋‹ค.1463๋ฒˆ ๋ฌธ์ œ๋Š” DP๋ฐฉ๋ฒ•์ค‘ ๋ฉ”๋ชจ์ด์ œ์ด์…˜์„ ์ด์šฉํ•ด์„œ ํ’€๋ฉด ์ตœ์ ํ™”๋œ ๋‹ต์ด ๋‚˜์™”๋‹ค. ๋‚ด ์ฝ”๋“œ - ์ •๋‹ต ๋ชป๋งž์ถค(์ ํ™”์‹ ์‚ฌ์šฉX)#include using namespace std; long long c;vector v;long long minDiv(int N){ if (N 1); cout D[N] = D[N/2]+1 N-- -> D[N] = D[N-1]+1 */ memo[1] = 0;//1์ผ๋•Œ๋Š” ์ •๋‹ต์ด๋ฏ€๋กœ ํšŸ์ˆ˜X for (int i = 2; i

    [๋ฐฑ์ค€] ์ž…์ถœ๋ ฅ ๋ฌธ์ œ - 2557, 1000, 2558, 10950, 10951, 10952, 10953, 11021, 11022, 11718, 11719, 11720, 11721, 2741, 2742, 2739, 1924, 8393, 10818, 2438, 2439, 2440, 2441, 2442, 2445, 2522, 2446, 10991, 10992

    2557๋ฒˆ – Hello world #include using namespace std; int main() { printf("Hello World!"); return 0; } 1000๋ฒˆ- A+B, 2558๋ฒˆ - A+B2 #include using namespace std; int main() { int a, b; cin >> a >> b; cout a >> b; cout b) cout b; if (a == 0 && b == 0) break; else cout a >> c >> b; if (a + b == 0) break; else cout a >> b; cout

    [์นด์นด์˜ค] 2018๋ธ”๋ผ์ธ๋“œ์ฑ„์šฉ - 1๋ฒˆ ๋ฌธ์ œ(์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ)

    [ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๋งํฌ] ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต - ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ | ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ ์นด์นด์˜คํ†ก ์˜คํ”ˆ์ฑ„ํŒ…๋ฐฉ์—์„œ๋Š” ์นœ๊ตฌ๊ฐ€ ์•„๋‹Œ ์‚ฌ๋žŒ๋“ค๊ณผ ๋Œ€ํ™”๋ฅผ ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ๋ณธ๋ž˜ ๋‹‰๋„ค์ž„์ด ์•„๋‹Œ ๊ฐ€์ƒ์˜ ๋‹‰๋„ค์ž„์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฑ„ํŒ…๋ฐฉ์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋‹ค. ์‹ ์ž…์‚ฌ์›์ธ ๊น€ํฌ๋ฃจ๋Š” ์นด์นด์˜คํ†ก ์˜คํ”ˆ ์ฑ„ํŒ…๋ฐฉ์„ ๊ฐœ์„คํ•œ ์‚ฌ๋žŒ์„ ์œ„ํ•ด, ๋‹ค์–‘ํ•œ ์‚ฌ๋žŒ๋“ค์ด ๋“ค์–ด์˜ค๊ณ , ๋‚˜๊ฐ€๋Š” ๊ฒƒ์„ ์ง€์ผœ๋ณผ ์ˆ˜ ์žˆ๋Š” ๊ด€๋ฆฌ์ž์ฐฝ์„ ๋งŒ๋“ค๊ธฐ๋กœ ํ–ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ์— ๋ˆ„๊ตฐ๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋œ๋‹ค. [๋‹‰๋„ค์ž„]๋‹˜์ด ๋“ค์–ด์™”์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ…๋ฐฉ์—์„œ ๋ˆ„๊ตฐ๊ฐ€ ๋‚˜๊ฐ€๋ฉด ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋œ๋‹ค. [๋‹‰๋„ค์ž„]๋‹˜์ด ๋‚˜๊ฐ”์Šต๋‹ˆ๋‹ค. ์ฑ„ํŒ… programmers.co.kr ์ถœ์ฒ˜ : '19 ์นด์นด์˜ค ์ฝ”๋”ฉ ํ…Œ์ŠคํŠธ (C++) - YouTube www.youtube.com #์–ธ์–ด : c++ stringstream์€ ๋ฌธ์ž์—ด์„ ์กฐ์ž‘ํ•˜๊ณ  ..

    [๋ฐฑ์ค€] 1058๋ฒˆ - ์นœ๊ตฌ

    ๋ฌธ์ œ ์ง€๋ฏผ์ด๋Š” ์„ธ๊ณ„์—์„œ ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ์‚ฌ๋žŒ์ด ๋ˆ„๊ตฌ์ธ์ง€ ๊ถ๊ธˆํ•ด์กŒ๋‹ค. ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ์‚ฌ๋žŒ์„ ๊ตฌํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๊ฐ ์‚ฌ๋žŒ์˜ 2-์นœ๊ตฌ๋ฅผ ๊ตฌํ•˜๋ฉด ๋œ๋‹ค. ์–ด๋–ค ์‚ฌ๋žŒ A๊ฐ€ ๋˜๋‹ค๋ฅธ ์‚ฌ๋žŒ B์˜ 2-์นœ๊ตฌ๊ฐ€ ๋˜๊ธฐ ์œ„ํ•ด์„ , ๋‘ ์‚ฌ๋žŒ์ด ์นœ๊ตฌ์ด๊ฑฐ๋‚˜, A์™€ ์นœ๊ตฌ์ด๊ณ , B์™€ ์นœ๊ตฌ์ธ C๊ฐ€ ์กด์žฌํ•ด์•ผ ๋œ๋‹ค. ์—ฌ๊ธฐ์„œ ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ์‚ฌ๋žŒ์€ 2-์นœ๊ตฌ์˜ ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ๋งŽ์€ ์‚ฌ๋žŒ์ด๋‹ค. ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ์‚ฌ๋žŒ์˜ 2-์นœ๊ตฌ์˜ ์ˆ˜๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. A์™€ B๊ฐ€ ์นœ๊ตฌ๋ฉด, B์™€ A๋„ ์นœ๊ตฌ์ด๊ณ , A์™€ A๋Š” ์นœ๊ตฌ๊ฐ€ ์•„๋‹ˆ๋‹ค. ์ž…๋ ฅ ์ฒซ์งธ ์ค„์— ์‚ฌ๋žŒ์˜ ์ˆ˜ N์ด ์ฃผ์–ด์ง„๋‹ค. N์€ 50๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์€ ์ž์—ฐ์ˆ˜์ด๋‹ค. ๋‘˜์งธ ์ค„๋ถ€ํ„ฐ N๊ฐœ์˜ ์ค„์— ๊ฐ ์‚ฌ๋žŒ์ด ์นœ๊ตฌ์ด๋ฉด Y, ์•„๋‹ˆ๋ฉด N์ด ์ฃผ์–ด์ง„๋‹ค. (์˜ˆ์ œ๋ฅผ ์ฐธ๊ณ ) ์ถœ๋ ฅ ์ฒซ์งธ ์ค„์— ๊ฐ€์žฅ ์œ ๋ช…ํ•œ ์‚ฌ๋žŒ์˜ 2-์นœ๊ตฌ์˜ ์ˆ˜๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. #์–ธ์–ด : ..