๋ถ๋ฅ ์ ์ฒด๋ณด๊ธฐ
-
Kotlin ๐ฌ ๋ฐฑ์ค 14๋จ๊ณ :: 10815 ๋ฒ2024. 2. 29. 16:25
์ซ์ ์นด๋ ๋ฌธ์ | ์ซ์ ์นด๋๋ ์ ์ ํ๋๊ฐ ์ ํ์ ธ ์๋ ์นด๋์ด๋ค. ์๊ทผ์ด๋ ์ซ์ ์นด๋ N๊ฐ๋ฅผ ๊ฐ์ง๊ณ ์๋ค. ์ ์ M๊ฐ๊ฐ ์ฃผ์ด์ก์ ๋, ์ด ์๊ฐ ์ ํ์๋ ์ซ์ ์นด๋๋ฅผ ์๊ทผ์ด๊ฐ ๊ฐ์ง๊ณ ์๋์ง ์๋์ง๋ฅผ ๊ตฌํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค. ์ ๋ ฅ | ์ฒซ์งธ ์ค์ ์๊ทผ์ด๊ฐ ๊ฐ์ง๊ณ ์๋ ์ซ์ ์นด๋์ ๊ฐ์ N(1 ≤ N ≤ 500,000)์ด ์ฃผ์ด์ง๋ค. ๋์งธ ์ค์๋ ์ซ์ ์นด๋์ ์ ํ์๋ ์ ์๊ฐ ์ฃผ์ด์ง๋ค. ์ซ์ ์นด๋์ ์ ํ์๋ ์๋ -10,000,000๋ณด๋ค ํฌ๊ฑฐ๋ ๊ฐ๊ณ , 10,000,000๋ณด๋ค ์๊ฑฐ๋ ๊ฐ๋ค. ๋ ์ซ์ ์นด๋์ ๊ฐ์ ์๊ฐ ์ ํ์๋ ๊ฒฝ์ฐ๋ ์๋ค. ์ ์งธ ์ค์๋ M(1 ≤ M ≤ 500,000)์ด ์ฃผ์ด์ง๋ค. ๋ท์งธ ์ค์๋ ์๊ทผ์ด๊ฐ ๊ฐ์ง๊ณ ์๋ ์ซ์ ์นด๋์ธ์ง ์๋์ง๋ฅผ ๊ตฌํด์ผ ํ M๊ฐ์ ์ ์๊ฐ ์ฃผ์ด์ง๋ฉฐ, ์ด ์๋ ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ..
-
Kotlin ๐ฌ ๋ฐฑ์ค 13๋จ๊ณ :: 18870 ๋ฒ2023. 8. 11. 21:41
์ขํ ์์ถ ๋ฌธ์ | ์์ง์ ์์ N๊ฐ์ ์ขํ $X_{1}$, $X_{2}$, ..., $X_{N}$์ด ์๋ค. ์ด ์ขํ์ ์ขํ ์์ถ์ ์ ์ฉํ๋ ค๊ณ ํ๋ค. $X_{i}$๋ฅผ ์ขํ ์์ถํ ๊ฒฐ๊ณผ $X'_{i}$์ ๊ฐ์ $X_{i}$ > $X_{j}$๋ฅผ ๋ง์กฑํ๋ ์๋ก ๋ค๋ฅธ ์ขํ $X_{j}$์ ๊ฐ์์ ๊ฐ์์ผ ํ๋ค. $X_{1}$, $X_{2}$, ..., $X_{N}$์ ์ขํ ์์ถ์ ์ ์ฉํ ๊ฒฐ๊ณผ $X'_{1}$, $X'_{2}$, ..., $X'_{N}$๋ฅผ ์ถ๋ ฅํด๋ณด์. ์ ๋ ฅ | ์ฒซ์งธ ์ค์ N์ด ์ฃผ์ด์ง๋ค. ๋์งธ ์ค์๋ ๊ณต๋ฐฑ ํ ์นธ์ผ๋ก ๊ตฌ๋ถ๋ $X_{1}$, $X_{2}$, ..., $X_{N}$์ด ์ฃผ์ด์ง๋ค. ์ถ๋ ฅ | ์ฒซ์งธ ์ค์ $X'_{1}$, $X'_{2}$, ..., $X'_{N}$์ ๊ณต๋ฐฑ ํ ์นธ์ผ๋ก ๊ตฌ๋ถํด์ ์ถ๋ ฅ..
-
[Git] Describe2023. 8. 10. 14:48
โ๏ธ Describe - ๊ฐ์ฅ ๊ฐ๊น์ด tag ์์น๋ฅผ ์๋ด git describe - ref์๋ ์ปค๋ฐ์ ์๋ฏธํ๋ ๊ฐ ์ ๋ ฅ - ref๋ฅผ ํน์ ์ง์ด์ฃผ์ง ์์ผ๋ฉด git์ ํ์ฌ checkout๋ ์์น, ์ฆ HEAD๋ฅผ ์ฐธ์กฐ ๐ ๋ช ๋ น์ด ์ถ๋ ฅ ํํ __g - tag : ๊ฐ์ฅ ๊ฐ๊น์ด ํ๊ทธ - numCommits : ๋ช ๊ฐ์ ์ปค๋ฐ ์์ ์๋์ง ์๋ด - hash : refํ ์์น ์ปค๋ฐ์ ํด์
-
[Git] Interactive Rebase2023. 8. 8. 12:06
โ๏ธ Interactive Rebase - cherry-pick์ ์ํ๋ ์ปค๋ฐ์ด ๋ฌด์์ธ์ง, ํด์ ๊ฐ์ ์ ๋ ์ ์ฉํ๋ค. ํ์ง๋ง ์ํ๋ ์ปค๋ฐ์ ๋ชจ๋ฅด๋ ์ํฉ์์๋ cherry-pick์ ์ฌ์ฉํ ์ ์๋ค. ํด๋น ์ํฉ์์ ๋์์ฑ ์ผ๋ก ๋์จ ๊ฒ์ด interative rebase์ด๋ค. - rebase๋ฅผ ์ฌ์ฉํ ๋ -i ์ต์ ์ ์ฌ์ฉ - -i ์ต์ ์ฌ์ฉ ์, ๋ณต์ฌ๋ ์ปค๋ฐ์ ๋ณด์ฌ์ฃผ๋ vim (ํ ์คํธ ํธ์ง๊ธฐ)์์ ํ์ผ ํ์ ๐ vim ํ์ผ ํ์ ์ ์ํ ๊ฐ๋ฅํ ๊ธฐ๋ฅ 1. ์ ์ฉํ ์ปค๋ฐ๋ค์ ์์ ๋ณ๊ฒฝ ๊ฐ๋ฅ 2. ์ํ์ง ์๋ ์ปค๋ฐ ์ ๊ฑฐ ๊ฐ๋ฅ - pick ์ ์ด์ฉํด ์ง์ 3. ์ปค๋ฐ squash(์ค์ฟผ์) ๊ฐ๋ฅ - ์ปค๋ฐ ๋ณํฉ git rebase -i HEAD~4
-
[AOS] Android Studio Plugin ์ถ์ฒ2023. 8. 6. 21:39
์๋๋ก์ด๋ ์คํ๋์ค์๋ ๋ค์ํ Plugin์ด ์๋ค. ๊ทธ ์ค ๋ง์ ์ฌ๋๋ค์ด ์ฌ์ฉํ๋ ํ๋ฌ๊ทธ์ธ์ ์ถ์ฒํด๋ณด๋ ค ํ๋ค. ๐กPlugin ์ค์น ๋ฐฉ๋ฒ Plugin ์ถ์ฒ์ ๋ค์ด๊ฐ๊ธฐ ์ , ์๋๋ก์ด๋ ์คํ๋์ค์์ Plugin์ ์ค์นํ๋ ๋ฐฉ๋ฒ * Mac OS ๊ธฐ์ค 1. ์๋จ ๋ฉ๋ด์ Android Studio > Preferences... 2. Plugins์ Marketplace์์ ์ํ๋ ํ๋ฌ๊ทธ์ธ ๊ฒ์ ํ ๋ค์ด๋ก๋ 1. Git Tool Box ์ปค์๊ฐ ์๋ ์ฝ๋๊ฐ ์ธ์ , ๋๊ฐ ์ปค๋ฐํ๋์ง ์ปค๋ฐ ๋ฉ์์ง์ ํจ๊ป ๊น ํ์คํ ๋ฆฌ๋ฅผ ๊ฐํธํ๊ฒ ํ์ธํ ์ ์๊ฒ ํด์ค๋ค. GitToolBox - IntelliJ IDEs Plugin | Marketplace Extends Git Integration with additional features ..
-
[Git] Reset & Revert2023. 8. 6. 02:25
โ๏ธ Reset - ์์ ๋ด์ญ ๋ณต๊ตฌ - ๋ธ๋์น๋ฅผ ์์ ์ ์ปค๋ฐ์ ๊ฐ๋ฆฌํค๋๋ก ์ด๋์ํค๋ ๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝ ๋ด์ฉ ๋ณต๊ตฌ - ์ฆ, ์ปค๋ฐํ์ง ์์๋ ๊ฒ์ฒ๋ผ ์์ ์ปค๋ฐ์ผ๋ก ๋ธ๋์น๋ฅผ ์ด๋ git reset HEAD~1 - ๋ก์ปฌ ๋ธ๋์น์์ ์ฌ์ฉํ๊ธฐ ์ฉ์ดํ๋, remote ๋ธ๋์น(push๋ ๋ธ๋์น)์์๋ ์ฌ์ฉ ๋ถ๊ฐ๋ฅํ๋ค. โ๏ธ Revert - remote ๋ธ๋์น์์ ๋ณ๊ฒฝ ๋ด์ญ์ ๋๋๋ฆด ๋ ์ฌ์ฉํ๊ธฐ ์ฉ์ด git revert HEAD