๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ“ ์•Œ๊ณ ๋ฆฌ์ฆ˜

(142)
[C++/SWEA] 1215. [S/W ๋ฌธ์ œํ•ด๊ฒฐ ๊ธฐ๋ณธ] 3์ผ์ฐจ - ํšŒ๋ฌธ1 (D3) https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&contestProbId=AV14QpAaAAwCFAYi&categoryId=AV14QpAaAAwCFAYi&categoryType=CODE&problemTitle=&orderBy=PASS_RATE&selectCodeLang=CCPP&select-1=3&pageSize=10&pageIndex=2 SW Expert AcademySW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!swexpertacademy.com ํšŒ๋ฌธ..๋ฐ˜๋ณต๋ฌธ ์•ˆ์— ๋ณ€์ˆ˜ 2๊ฐœ ๋„ฃ๋Š”๊ฑฐ ์ฒ˜์Œ ํ•ด๋ด„ใ…‹ใ…‹ ์ด์ค‘๋ฐ˜๋ณต๋ฌธ๋ณด๋‹ค ๊น”๋”ํ•˜๊ธด ํ•˜๋‹ค๊ฐ€๋กœ ๊ฐฏ์ˆ˜ ๊ตฌํ•˜๊ณ , ์„ธ๋กœ ๊ฐฏ์ˆ˜ ๊ตฌํ•ด์„œ ๋”ํ•˜๊ธฐ ๋‚˜์˜ ํ’€์ด#inc..
[C++/SWEA] 1206. [S/W ๋ฌธ์ œํ•ด๊ฒฐ ๊ธฐ๋ณธ] 1์ผ์ฐจ - View (D3) https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&contestProbId=AV134DPqAA8CFAYh&categoryId=AV134DPqAA8CFAYh&categoryType=CODE&problemTitle=&orderBy=RECOMMEND_COUNT&selectCodeLang=CCPP&select-1=3&pageSize=10&pageIndex=1 SW Expert AcademySW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!swexpertacademy.com ์ตœ๋Œ“๊ฐ’ ์•„์ด๋””์–ด ๋‚˜์˜ ํ’€์ด#include#include#includeusing namespace std;int main(int a..
[C++/PGS] Lv.3 : ์„ฌ ์—ฐ๊ฒฐํ•˜๊ธฐ (๊ทธ๋ฆฌ๋”” Greedy) https://school.programmers.co.kr/learn/courses/30/lessons/42861 ํ”„๋กœ๊ทธ๋ž˜๋จธ์ŠคSW๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ํ‰๊ฐ€, ๊ต์œก, ์ฑ„์šฉ๊นŒ์ง€ Total Solution์„ ์ œ๊ณตํ•˜๋Š” ๊ฐœ๋ฐœ์ž ์„ฑ์žฅ์„ ์œ„ํ•œ ๋ฒ ์ด์Šค์บ ํ”„programmers.co.kr ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๊ทธ๋ฆฌ๋”” - ์„ฌ ์—ฐ๊ฒฐํ•˜๊ธฐ ๋ฌธ์ œ ์›๋ž˜๋Š” ๊ฐ ํŠธ๋ฆฌ์˜ ์ตœ์ƒ๋‹จ ๋ถ€๋ชจ๊ฐ’์„ ์žฌ๊ท€์ ์œผ๋กœ ์ฐพ๋Š” ๊ฒŒ ์ •์„ ํ’€์ด์ธ๋ฐ,๋‚˜๋Š” ๋ณต์žกํ•ด์„œ ๊ทธ๋ƒฅ ์ธ๋ฑ์Šค ๋ฐฐ์—ด์— ์ตœ์†Œ ๋ถ€๋ชจ๊ฐ’๋งŒ ์ €์žฅํ•ด๋†“๊ณ  ๋ฐ˜๋ณต๋ฌธ์œผ๋กœ ๊ฐฑ์‹ ํ–ˆ๋‹ค. 1. ์ตœ์†Œ ์‹ ์žฅ ํŠธ๋ฆฌ๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด, Greedy๋กœ ์ตœ์†Ÿ๊ฐ’ ๊ฐ„์„ ๋ถ€ํ„ฐ ์ฐพ๋Š” ๊ฒŒ ํฌ์ธํŠธ!2. ๊ฐ ํŠธ๋ฆฌ์˜ ์ตœ์†Œ ๋ถ€๋ชจ๊ฐ’์„ ๋น„๊ตํ•ด์„œ, ๊ฐ™์œผ๋ฉด ํ•œ ํŠธ๋ฆฌ ๋‚ด๋ถ€์— ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ๋ณด๊ณ , ๋‹ค๋ฅด๋‹ค๋ฉด ๋‘ ํŠธ๋ฆฌ๋ฅผ ์ด์–ด์คŒ.  ๋‚˜์˜ ํ’€์ด#include #include #include #..
[C++/PGS] Lv.1 : ๋‹ฌ๋ฆฌ๊ธฐ ๊ฒฝ์ฃผ (ํ•ด์‹œ๋งต Map) https://school.programmers.co.kr/learn/courses/30/lessons/178871 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”.programmers.co.kr  ์ฒ˜์Œ์— 2์ค‘ ๋ฐ˜๋ณต๋ฌธ์„ ์‚ฌ์šฉํ–ˆ๋”๋‹ˆ ์‹œ๊ฐ„์ดˆ๊ณผ๊ฐ€ ๋œจ๊ธธ๋ž˜,ํ•ด์‹œ๋งต์„ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ๊ฒƒ์„ ๊นจ๋‹ฌ์•˜๋‹คMap์„ 2๊ฐœ ์“ฐ๋Š” ๋ฐฉ์‹ ๋“ฑ ํ’€์ด๊ฐ€ ๋‹ค์–‘ํ–ˆ๋Š”๋ฐ, ๋‚˜๋Š” unordered map ํ•˜๋‚˜๋กœ players์˜ ์ธ๋ฑ์Šค๋ฅผ ๋ฐ”๋กœ ๊ฒ€์ƒ‰ํ•ด์„œ ํ•ด๊ฒฐํ•จ ๋‚˜์˜ ํ’€์ด#include #include #include using namespace std;vector solution(vector players, vector callings) ..
[Javascript(NodeJS)/Softeer] Lv1. A+B https://softeer.ai/practice/6295 Softeer - ํ˜„๋Œ€์ž๋™์ฐจ๊ทธ๋ฃน SW์ธ์žฌํ™•๋ณดํ”Œ๋žซํผ softeer.ai ํ˜„๋Œ€ ์†Œํ”„ํ‹ฐ์–ด Lv1. A+B js ํ’€์ด ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ฝ”ํ…Œ ์‰ฝ์ง€์•Š๋‹ค๊ทธ๋ž˜๋„ ๊ฐœ๋ฐœ ์งฌ๋ฐ”๋กœ ์–ด์ฐŒ์–ด์ฐŒ ๊ทน๋ณตํ•˜๋Š”์ค‘..^-^const readline = require('readline');const rl = readline.createInterface({ input: process.stdin, output: process.stdout});let sum = 0;let result = [];rl.on('line', input =>{ arr = input.split(' ').map(el=>parseInt(el)); if(arr.length >1) { sum = a..
[Javascript(NodeJS)/Softeer] Lv1. ๊ทผ๋ฌด ์‹œ๊ฐ„ https://softeer.ai/practice/6254 Softeer - ํ˜„๋Œ€์ž๋™์ฐจ๊ทธ๋ฃน SW์ธ์žฌํ™•๋ณดํ”Œ๋žซํผ softeer.ai ํ˜„๋Œ€ ์†Œํ”„ํ‹ฐ์–ด Lv1. ๊ทผ๋ฌด ์‹œ๊ฐ„ js ํ’€์ด ๊ฐ‘์ž๊ธฐ ์ฝ”ํ…Œ ์‘์‹œ ์–ธ์–ด๊ฐ€ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ผ๋Š” ๊ฑธ ์•Œ๊ฒŒ๋œ ๋‚˜๊ธ‰ํ•˜๊ฒŒ ์—ฐ์Šต๋ฌธ์ œ๋ฅผ ํ’€์–ด๋ณด๋Š”๋ฐ.....๊ทธ๋ƒฅ ๋„์ „ํ•˜๋Š”๊ฑฐ์ง€๋ญ~~~const readline = require('readline');const rl = readline.createInterface({ input: process.stdin, output: process.stdout});let sum = 0;min = 0;hour = 0;rl.on('line',input =>{ time = input.split(' '); timesp = time.map(t=>t.split('..
[C++/Softeer] Lv3. ์ˆœ์„œ๋Œ€๋กœ ๋ฐฉ๋ฌธํ•˜๊ธฐ (HSAT 7ํšŒ ์ •๊ธฐ ์ฝ”๋”ฉ ์ธ์ฆํ‰๊ฐ€ ๊ธฐ์ถœ) https://softeer.ai/practice/6246/history?questionType=ALGORITHM Softeer - ํ˜„๋Œ€์ž๋™์ฐจ๊ทธ๋ฃน SW์ธ์žฌํ™•๋ณดํ”Œ๋žซํผ softeer.ai ํ˜„๋Œ€ ์†Œํ”„ํ‹ฐ์–ด Lv3. ์ˆœ์„œ๋Œ€๋กœ ๋ฐฉ๋ฌธํ•˜๊ธฐ C++ ํ’€์ด ๋ฌธ์ œ ๋‚œ์ด๋„๋Š” ์ ์ ˆํ•ด๋ณด์ด๋‚˜, ์กฐ๊ฑด ์„ค๋ช…์ด ์•ฝ๊ฐ„ ์•„์‰ฌ์› ๋˜ ๋ฌธ์ œ.์ตœ๋‹จ๊ฑฐ๋ฆฌ๋Š” ์•„๋‹ˆ๊ณ  ๋ฐฉ๋ฌธํ–ˆ๋˜ ์นธ์„ ๋‹ค์‹œ ์ง€๋‚˜์ง€๋งŒ ์•Š์œผ๋ฉด ๋˜๋Š”๋“ฏ์ „์ฒด dfs ๊ฒฝ์šฐ ์ค‘, ์ˆœ์ฐจ์ ์œผ๋กœ ์ €์žฅ๋œ ์ง€์ ์„ ๊ฑฐ์น˜๋Š” ๊ฒฝ์šฐ๋งŒ์„ countํ•ด์„œ ํ•ด๊ฒฐํ–ˆ๋‹ค.#include#include #include using namespace std;int grid[4][4]={0,};int visited[4][4]={0,};int n; int m;vector> store;int dx[4] = {0,1,0,-1};int dy[4]..
[C++/Softeer] Lv2. ํšŒ์˜์‹ค ์˜ˆ์•ฝ https://softeer.ai/practice/6266 Softeer - ํ˜„๋Œ€์ž๋™์ฐจ๊ทธ๋ฃน SW์ธ์žฌํ™•๋ณดํ”Œ๋žซํผ softeer.ai ํ˜„๋Œ€ ์†Œํ”„ํ‹ฐ์–ด Lv2. ํšŒ์˜์‹ค ์˜ˆ์•ฝ C++ ํ’€์ด ์ฒซ ์ œ์ถœ์—์„œ Subtask 2๊ฐœ๊ฐ€ ์˜ค๋‹ต์œผ๋กœ ๋–ด๋‹ค. ์ œ์ผ ๊ฐ„๋‹จํ•œ ๋ฐ˜๋ก€ ํƒ์ƒ‰๋ฒ•์ธ ๋ธ”๋ž™๋ฐ•์Šค-๊ฒฝ๊ณ„๊ฐ’ ๋ถ„์„์œผ๋กœ ๋ฐ˜๋ก€๋ฅผ ์ฐพ์•„๋ณด์ž!-> ์•„๋ž˜ ์ผ€์ด์Šค์—์„œ, b๋Š” 17-18์ด ๊ฐ€๋Šฅํ•œ๋ฐ not available์ด ์ถœ๋ ฅ๋จ2 2a ba 9 10b 9 17 ๊ฐ€๋Šฅํ•œ ์‹œ๊ฐ„๋Œ€ pair๋ฅผ ๊ตฌํ•  ๋•Œ, ๋ฐ˜๋ณต๋ฌธ์ด ๋๋‚œ ๋’ค์— isAble true ์„ค์ •์„ ์•ˆํ•ด์ค˜์„œ ์ƒ๊ฒผ๋˜ ์˜ค๋ฅ˜.์ถ”๊ฐ€ํ•ด์คฌ๋”๋‹ˆ ํ†ต๊ณผ!!#include#include #include #include using namespace std;int main(int argc, char** argv){ int roo..

728x90