์ ์ฒด ๊ธ

๋นํธ๋ง์คํฌ ์๊ณ ๋ฆฌ์ฆ
๋์ ๋นํธ๋ง์คํฌ ์๊ณ ๋ฆฌ์ฆ์ ๋นํธ์ฐ์ฐ์๋ฅผ ํ์ฉํด ๊ฐ๋จํ๊ฒ ์งํฉ์ ํํํ๋ ์๊ณ ๋ฆฌ์ฆ์ด๋ค. ๋นํธ๋ง์คํฌ๋ฅผ ์ฌ์ฉํ๋ฉด ํ๋์ ์ ์๋ก ์ฌ๋ฌ๊ฐ์ง ์งํฉ์ ํํํ ์ ์๋ค. ํ์ง๋ง ์ฌ๋ฌ๊ฐ์ง ์ ์ฝ์ฌํญ์ด ์์ผ๋ฏ๋ก ์ฌ์ฉ์ ์์ด ์ฃผ์ํด์ผํ๋ฉฐ ์ฃผ๋ก ๋ค์ด๋๋ฏน ํ๋ก๊ทธ๋๋ฐ์์ ์ฃผ๋ก ์ฌ์ฉํ๋ค. ๋นํธ์ฐ์ฐ | ์ฐ์ฐ : or์ฐ์ฐ์ผ๋ก ๋ ์ค ํ๋๊ฐ 1์ด๋ฉด 1์ด๋ค. &์ฐ์ฐ : and์ฐ์ฐ์ผ๋ก ๋ ๋ค 1์ด์ด์ผ 1์ด๋ค. ^์ฐ์ฐ : xor์ฐ์ฐ์ผ๋ก ๋๊ฐ์ ์ฐ์ฐ์๊ฐ ์๋ก ๋ค๋ฅธ ๊ฐ์ด์ด์ผ 1์ด๋ค. ~์ฐ์ฐ : not์ฐ์ฐ์ผ๋ก 1์ 0์ผ๋ก 0์ 1๋ก ๋ณ๊ฒฝํ์ฌ์ค๋ค. -shift์ฐ์ฐ- >> ์ฐ์ฐ์ ๋นํธ๋ฅผ ์ค๋ฅธ์ชฝ์ผ๋ก ๋ฏธ๋ ์ฐ์ฐ์ผ๋ก 2์ n์น์ ๋๋๋ ๊ฒ๊ณผ ๋์ผํ ๊ฒฐ๊ณผ๊ฐ ๋์จ๋ค.

HTTP Message Converter
๋์ HTTP์ ๋ฐ๋์ ๊ฐ์ ๋๊ฒจ์ค ๋ view๋ฅผ ํ์ฉํ์ฌ html์ ์์ฑํด์ ๋ณด๋ด์ค ์๋ ์๊ณ ๊ฐ๋จํ๊ฒ json์ด๋ String ํ์์ผ๋ก ๋๊ฒจ์ค ์ ์๋ค. json์ด๋ Stringํ์์ผ๋ก ๋๊ฒจ์ค๋๋ HTTP Message Converter๋ฅผ ์ฌ์ฉํ๋ฉด ํธ๋ฆฌํ๊ฒ ๋๊ฒจ์ค ์ ์๋ค. ์ค๋์ HTTP Message Converter๋ฅผ ์์๋ณด๋๋ก ํ๊ฒ ๋ค. HTTP Message Converter HttpMessageConverter๋ requset๋ก ๋์ด์จ body ๋ฐ์ดํฐ ๊ฐ์ ๋ฐ์์ค๊ฑฐ๋ ํน์ response๋ก ๋ฐ์ดํฐ๋ฅผ body์ ๋ณด๋ผ ๋ ์ ์ ํ๊ฒ ๋ณํํด์ฃผ๋ ์ญํ ์ ์ํํ๋ค. ์๋ฅผ๋ค์ด @ResponseBody annotation์ด ๋ถ์ด์๋ ๋ฉ์๋๊ฐ ์คํ์ด ๋ ๋ ์ ์ ํ HTTP Message Converter๋ฅผ ..

SSR Response, Response Body
๋์ ์๋ฒ์ ๊ฐ๋ฐ์๊ฐ ์ฌ์ฉ์์๊ฒ ํ์ด์ง๋ฅผ ๊ตฌ์ํ์ฌ ๋ณด์ฌ์ฃผ๋ ๊ฒ์ SSR(Server Side Rendering)์ด๋ผ๊ณ ํ๋ค. ์ฌ๋ฌ๊ฐ์ง ์ข ๋ฅ๊ฐ ์์ง๋ง ๋๋ ์ฃผ๋ก Thymeleaf๋ฅผ ์ฌ์ฉํ์ฌ ์ฒ๋ฆฌํ๋ค. ์ด๋ฒ์ ๊ณต๋ถํ ๋ด์ฉ์ ๋์ ์ธ ์นํ์ด์ง๋ฅผ ์ํด SpringMVC์์ ๋ฐ์ดํฐ๋ฅผ ๋๊ฒจ์ฃผ๋ ๋ฐฉ๋ฒ๊ณผ Response Body๋ฅผ ์์๋ณด๊ฒ ๋ค. View๋ก ๋ฐ์ดํฐ ๋๊ฒจ์ฃผ๋ ๋ฐฉ๋ฒ Thymeleaf๋ก ๋ฐ์ดํฐ๋ฅผ ๋๊ฒจ์ฃผ๋ ๋ค์ํ ๋ฐฉ๋ฒ์ ์์๋ณด๊ณ ์ ํ๋ค. @RequestMapping("/response-view-v1") public ModelAndView responseViewV1(){ ModelAndView mav = new ModelAndView("response/hello") .addObject("data","hello!");..
![[Backjoon_10971] ์ธํ์ ์ํ 2](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdjOatT%2FbtruITEj8Dh%2Fx1VA2IzPkVdKJ8zVdwM3h0%2Fimg.png)
[Backjoon_10971] ์ธํ์ ์ํ 2
๋ฌธ์ ๋งํฌ https://www.acmicpc.net/problem/10971 10971๋ฒ: ์ธํ์ ์ํ 2 ์ฒซ์งธ ์ค์ ๋์์ ์ N์ด ์ฃผ์ด์ง๋ค. (2 ≤ N ≤ 10) ๋ค์ N๊ฐ์ ์ค์๋ ๋น์ฉ ํ๋ ฌ์ด ์ฃผ์ด์ง๋ค. ๊ฐ ํ๋ ฌ์ ์ฑ๋ถ์ 1,000,000 ์ดํ์ ์์ ์ ์์ด๋ฉฐ, ๊ฐ ์ ์๋ ๊ฒฝ์ฐ๋ 0์ด ์ฃผ์ด์ง๋ค. W[i][j]๋ ๋์ i์์ j www.acmicpc.net ๋ฌธ์ ์ค๋ช ๋๋ณด๊ธฐ ๋๋ณด๊ธฐ ๋ฌธ์ ์ธํ์ ์ํ ๋ฌธ์ ๋ ์์ด๋ก Traveling Salesman problem (TSP) ๋ผ๊ณ ๋ถ๋ฆฌ๋ ๋ฌธ์ ๋ก computer science ๋ถ์ผ์์ ๊ฐ์ฅ ์ค์ํ๊ฒ ์ทจ๊ธ๋๋ ๋ฌธ์ ์ค ํ๋์ด๋ค. ์ฌ๋ฌ ๊ฐ์ง ๋ณ์ข ๋ฌธ์ ๊ฐ ์์ผ๋, ์ฌ๊ธฐ์๋ ๊ฐ์ฅ ์ผ๋ฐ์ ์ธ ํํ์ ๋ฌธ์ ๋ฅผ ์ดํด๋ณด์. 1๋ฒ๋ถํฐ N๋ฒ๊น์ง ๋ฒํธ๊ฐ ๋งค๊ฒจ์ ธ ์๋ ๋์๋ค์ด ์..