์ „์ฒด ๊ธ€ 278

[Python] ๋ณด๊ธ€ ๊ฒŒ์ž„ (BOGGLE)

์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋ฌธ์ œ ํ•ด๊ฒฐ ์ „๋žต - 06 ๋ฌด์‹ํ•˜๊ฒŒ ํ’€๊ธฐ (Brute-Force ๋ธŒ๋ฃจํŠธ ํฌ์Šค) ์˜ˆ์ œ: ๋ณด๊ธ€ ๊ฒŒ์ž„ (๋ฌธ์ œ ID: BOGGLE, ๋‚œ์ด๋„: ํ•˜) ๋ณด๊ธ€(boggle)์€ 5X5 ํฌ๊ธฐ์˜ ์•ŒํŒŒ๋ฒณ ๊ฒฉ์ž๋ฅผ ๊ฐ€์ง€๊ณ  ํ•˜๋Š” ๊ฒŒ์ž„ ๊ฒŒ์ž„์˜ ๋ชฉ์ ์€ ์ƒํ•˜์ขŒ์šฐ/๋Œ€๊ฐ์„ ์œผ๋กœ ์ธ์ ‘ํ•œ ์นธ๋“ค์˜ ๊ธ€์ž๋“ค์„ ์ด์–ด์„œ ๋‹จ์–ด๋ฅผ ์ฐพ์•„๋‚ด๋Š” ๊ฒƒ ๊ฐ ๊ธ€์ž๋“ค์€ ๋Œ€๊ฐ์„ ์œผ๋กœ๋„ ์ด์–ด์งˆ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํ•œ ๊ธ€์ž๊ฐ€ ๋‘ ๋ฒˆ ์ด์ƒ ์‚ฌ์šฉ๋  ์ˆ˜๋„ ์žˆ์Œ ๋ฌธ์ œ ์ดํ•ดํ–ˆ๊ณ  C++๋กœ ๊ตฌํ˜„๋˜์–ด ์žˆ๋Š” ์ฝ”๋“œ๋ฅผ ํŒŒ์ด์ฌ์œผ๋กœ ์ž˜ ๋ณ€๊ฒฝํ–ˆ๋‹ค ๊ทธ๋Œ€๋กœ ๋ณ€๊ฒฝํ•˜์ง€ ์•Š๊ณ  ์‹œ์ž‘์ ์„ ์ฃผ์ง€ ์•Š๊ณ  ๋ชจ๋“  ์นธ์„ ๋Œ๋ฉด์„œ ์ฐพ๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ๋ณ€๊ฒฝํ•˜์˜€๋‹ค # ๋ณด๊ธ€ ๊ฒŒ์ž„ํŒ์—์„œ ๋‹จ์–ด๋ฅผ ์ฐพ๋Š” ์žฌ๊ท€ ํ˜ธ์ถœ ์•Œ๊ณ ๋ฆฌ์ฆ˜ dx = [-1, -1, -1, 1, 1, 1, 0, 0] dy = [-1, 0, 1, -1, 0, 1, -1, 1] def..

[BOJ/Step6] ํ•จ์ˆ˜ (C++)

https://www.acmicpc.net/problem/15596 : ์ •์ˆ˜ N๊ฐœ์˜ ํ•ฉ #include #include #include using namespace std; long long sum(std::vector &a){ long long sum = 0; vector::iterator ptr; for (ptr = a.begin(); ptr != a.end(); ++ptr) sum += *ptr; return sum; } https://www.acmicpc.net/problem/4673 : ์…€ํ”„ ๋„˜๋ฒ„ #include using namespace std; bool self[10001]; int d(int a){ int num = a; while (true){ if (a == 0) break; num ..

[BOJ/Step5] 1์ฐจ์› ๋ฐฐ์—ด (C++)

https://www.acmicpc.net/problem/10818 : ์ตœ์†Œ, ์ตœ๋Œ€ #include #include using namespace std; int main(void){ int n = 0; cin >> n; int *num = new int[n]; for (int i = 0; i > a; num[i] = a; } sort(num, num + n); cout c; int num = a * b * c; while(num != 0){ arr[num%10]++; num /= 10; } for(int i=0; i s; score[i] = s; max = (s > max) ? s : max; } for(int i = 0; i < n; i++){ n_score[i..

[BOJ/Step12] 18870 : ์ขŒํ‘œ ์••์ถ• (Python)

https://www.acmicpc.net/problem/18870 18870๋ฒˆ: ์ขŒํ‘œ ์••์ถ• ์ˆ˜์ง์„  ์œ„์— N๊ฐœ์˜ ์ขŒํ‘œ X1, X2, ..., XN์ด ์žˆ๋‹ค. ์ด ์ขŒํ‘œ์— ์ขŒํ‘œ ์••์ถ•์„ ์ ์šฉํ•˜๋ ค๊ณ  ํ•œ๋‹ค. Xi๋ฅผ ์ขŒํ‘œ ์••์ถ•ํ•œ ๊ฒฐ๊ณผ X'i์˜ ๊ฐ’์€ Xi > Xj๋ฅผ ๋งŒ์กฑํ•˜๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ์ขŒํ‘œ์˜ ๊ฐœ์ˆ˜์™€ ๊ฐ™์•„์•ผ ํ•œ๋‹ค. X1, X2, ..., XN์— ์ขŒ www.acmicpc.net ์—ฌ๋Ÿฌ ๋ฐฉ๋ฒ•์„ ์จ๋ดค๋Š”๋ฐ ๋‹ค ์‹œ๊ฐ„์ดˆ๊ณผ... ์ž…๋ ฅ ๋ฐฉ๋ฒ•๋•Œ๋ฌธ์ธ๊ฐ€ ์‹ถ์–ด์„œ sys ๋ชจ๋“ˆ readline ํ•จ์ˆ˜๋กœ๋„ ๋ฐ”๊ฟ”๋ดค๋Š”๋ฐ ๊ณ„์† ์‹œ๊ฐ„์ดˆ๊ณผ๊ฐ€ ๋‚œ๋‹ค ๋ญ๋•Œ๋ฌธ์ผ๊นŒ?.. ๊ทธ๋ƒฅ ๋„ˆ๋ฌด ์˜ค๋ž˜ ๊ฑธ๋ ค์„œ ์‹œ๊ฐ„์ดˆ๊ณผ์˜€์Œ ใ…Ž.. ๋จธ๋ฆฌ๊ฐ€ ๋‹ค ๊ตณ์–ด๋ฒ„๋ฆฐ๊ฑฐ๊ฐ™๋‹ค ๊ณ„์† ์‹œ๊ฐ„์ดˆ๊ณผ๋‚˜์„œ ์ฐพ์•„๋ดค๋Š”๋ฐ๋„ ์ดํ•ด๊ฐ€ ์•ˆ๋˜์„œ ํ•œ์ฐธ ๋ฒ„๋ฒ…๋Œ ์งง๊ณ  ๊ฐ„๋‹จํ•˜๊ฒŒ ํ’€๋ฆฌ๋Š” ๋ฌธ์ œ์˜€๋Š”๋ฐ ๋”•์…”๋„ˆ๋ฆฌ ๋„ˆ๋ฌด ์˜ค๋žœ๋งŒ์ด๋ผ ๋” ๊ทธ๋žฌ๋˜ ๋“ฏ....

21-05-11

๋ฉฐ์น ์ „์— MBTI ๊ฒ€์‚ฌ๋ฅผ ํ–ˆ๋‹ค ๋‚ด๋ˆ๋‚ด์‚ฐ ๋ฌด๋ ค 33000์›์ด๋‚˜ ์ฃผ๊ณ  ํ–ˆ๋Š”๋ฐ ์ „์— ์•ผ๋งค๋กœ ํ•œ ๊ฒ€์‚ฌ๋ž‘ ๊ฒฐ๊ณผ๊ฐ€ ๋˜‘๊ฐ™์•„์„œ ์กฐ๊ธˆ ์•„์ฃผ ์กฐ๊ธˆ ์‹ค๋ง์Šค๋Ÿฌ์› ์Œ ...ใ…Žใ…‹ ๊ทผ๋ฐ ๋ถ„์„ ๊ฒฐ๊ณผ? ๋ถ„์„์ง€? ์ฝ์–ด๋ณด๋‹ˆ๊นŒ ์ƒ๊ฐ๋ณด๋‹ค ํ›จ์”ฌ ์ž์„ธํ•˜๊ฒŒ ๋‚˜์™€์„œ ๋†€๋ž๊ณ  ๋‚ด ์žฅ์  ๋‹จ์ ์„ ์ข€ ๊ฐ๊ด€์ ์œผ๋กœ ์•Œ ์ˆ˜ ์žˆ์—ˆ๋‹ค๊ณ ๋‚˜ ํ• ๊นŒ ... ๊ทธ๋ฆฌ๊ณ  ๋ฌธ์ œ๋Š” ์ด๊ฒƒ์ด๋‹ค ์–ด์ œ ํƒœ์–ด๋‚˜์„œ ์ฒ˜์Œ์œผ๋กœ ์‚ฌ์ฃผ๋ฅผ ๋ดค๋Š”๋ฐ ..... ๋‚ด๊ฐ€ ์˜ฌํ•ด ์—„์ฒญ๋‚œ ํšก์žฌ์ˆ˜๊ณ  ์ง์žฅ ์šด์ด ์ข‹๋‹ค๊ณ  8์›”์— ์ทจ์—…์„ ํ• ๊ฑฐ๋ผ๋„ค????!???? ์‹ฌ์ง€์–ด 8์›”์ด๋ฉด ํ•œ์ฐธ ํ•˜๋ฐ˜๊ธฐ ๊ณต์ฑ„ ์‹œ์ฆŒ์ด ์•„๋‹Œ๊ฐ€!! ์›ํ•˜๋Š”๊ณณ ์กฐ๊ฑด ์ข‹์€ ๊ณณ์œผ๋กœ ๊ฐ„๋‹ค๊ณ  ๊ฑฑ์ •ํ•  ๊ฑฐ ์—†๋‹ค๊ณ  ํ•˜๋”๋ผ๊ตฌ ๊ธฐ๋ถ„์€ ์ง„์งœ ๋„˜๋ˆ„๋„˜๋ฌด๋ˆ„๋ฌด๋„ˆ๋ฌด ์ข‹๊ธด ํ–ˆ๋Š”๋ฐ ๋ฌธ์ œ๋Š” ... ๋‚ด๊ฐ€ ์š”์ฆ˜ ์ง„์งœ ์•”๊ฒƒ๋„ ์•ˆํ•˜๊ณ  ๋†€๊ณ ๋จน๋Š”๋ฐ ์ด๋ ‡๊ฒŒ ๋†€๊ณ ๋จน๋Š”๋ฐ๋„ ์ทจ์—…์ด ๋œ๋‹ค๋Š”๊ฒŒ ๋ง๋„ ์•ˆ๋˜๋Š”.. ๊ทธ๋Ÿฐ ๊ฒƒ..

20-05-07

์ •์‹  ์ฐจ๋ฆฌ๊ณ  ๋ณด๋‹ˆ ADsP๊ฐ€ 2์ฃผ๋„ ์•ˆ๋‚จ์•˜๊ณ ... ์—ฐ์Šต์‚ผ์•„ ์‹ ์ฒญํ•œ ์นด์นด์˜ค ์ฝ”ํ…Œ๊ฐ€ ๋ฐ”๋กœ ๋‚ด์ผ ..? ์‹œ๊ฐ„๋งŒ ์—„์ฒญ ๊ฐ„๋‹ค ๋‚˜๋Š” ์™œ ๊ณต๋ถ€๋ฅผ ํ•˜์ง€ ์•Š๋Š”๊ฐ€ ๊ฒŒ์ž„์— ํ™€๋ ค์„œ ํ–‰๋ณตํ•˜๊ณ  ์—ด์ •์ ์œผ๋กœ ๊ฒŒ์ž„์„ ์—ด์‹ฌํžˆ ํ•˜๊ณ  ์žˆ๋‹ค ๊ณต๋ถ€ํ•˜์ž..