Giken Dev
[๋ฐฑ์ค€][C] 1541๋ฒˆ ์žƒ์–ด๋ฒ„๋ฆฐ ๊ด„ํ˜ธ

https://www.acmicpc.net/problem/1541 1541๋ฒˆ: ์žƒ์–ด๋ฒ„๋ฆฐ ๊ด„ํ˜ธ ์ฒซ์งธ ์ค„์— ์‹์ด ์ฃผ์–ด์ง„๋‹ค. ์‹์€ ‘0’~‘9’, ‘+’, ๊ทธ๋ฆฌ๊ณ  ‘-’๋งŒ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๊ณ , ๊ฐ€์žฅ ์ฒ˜์Œ๊ณผ ๋งˆ์ง€๋ง‰ ๋ฌธ์ž๋Š” ์ˆซ์ž์ด๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์—ฐ์†ํ•ด์„œ ๋‘ ๊ฐœ ์ด์ƒ์˜ ์—ฐ์‚ฐ์ž๊ฐ€ ๋‚˜ํƒ€๋‚˜์ง€ ์•Š๊ณ , 5์ž๋ฆฌ๋ณด๋‹ค www.acmicpc.net ๋ฌธ์ œ ์„ธ์ค€์ด๋Š” ์–‘์ˆ˜์™€ +, -, ๊ทธ๋ฆฌ๊ณ  ๊ด„ํ˜ธ๋ฅผ ๊ฐ€์ง€๊ณ  ์‹์„ ๋งŒ๋“ค์—ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋‚˜์„œ ์„ธ์ค€์ด๋Š” ๊ด„ํ˜ธ๋ฅผ ๋ชจ๋‘ ์ง€์› ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋‚˜์„œ ์„ธ์ค€์ด๋Š” ๊ด„ํ˜ธ๋ฅผ ์ ์ ˆํžˆ ์ณ์„œ ์ด ์‹์˜ ๊ฐ’์„ ์ตœ์†Œ๋กœ ๋งŒ๋“ค๋ ค๊ณ  ํ•œ๋‹ค. ๊ด„ํ˜ธ๋ฅผ ์ ์ ˆํžˆ ์ณ์„œ ์ด ์‹์˜ ๊ฐ’์„ ์ตœ์†Œ๋กœ ๋งŒ๋“œ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์ž…๋ ฅ ์ฒซ์งธ ์ค„์— ์‹์ด ์ฃผ์–ด์ง„๋‹ค. ์‹์€ ‘0’~‘9’, ‘+’, ๊ทธ๋ฆฌ๊ณ  ‘-’๋งŒ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๊ณ , ๊ฐ€์žฅ ์ฒ˜์Œ๊ณผ ๋งˆ์ง€๋ง‰ ๋ฌธ์ž๋Š” ์ˆซ์ž์ด..

article thumbnail
Git ๋ช…๋ น์–ด ์š”์•ฝ์ง‘

git init : ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ Git์ด ๊ด€๋ฆฌํ•˜๋Š” ํ”„๋กœ์ ํŠธ ๋””๋ ‰ํ† ๋ฆฌ(=working directory)๋กœ ์„ค์ •ํ•˜๊ณ  ๊ทธ ์•ˆ์— ๋ ˆํฌ์ง€ํ† ๋ฆฌ(.git ๋””๋ ‰ํ† ๋ฆฌ) ์ƒ์„ฑ git config user.name 'zoozoo' : ํ˜„์žฌ ์‚ฌ์šฉ์ž์˜ ์•„์ด๋””๋ฅผ 'zoozoo'์œผ๋กœ ์„ค์ •(์ปค๋ฐ‹ํ•  ๋•Œ ํ•„์š”ํ•œ ์ •๋ณด) git config user.email 'zoozoo@naver.com' : ํ˜„์žฌ ์‚ฌ์šฉ์ž์˜ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ 'zoozoo@naver.com'๋กœ ์„ค์ •(์ปค๋ฐ‹ํ•  ๋•Œ ํ•„์š”ํ•œ ์ •๋ณด) git add [ํŒŒ์ผ ์ด๋ฆ„] : ์ˆ˜์ •์‚ฌํ•ญ์ด ์žˆ๋Š” ํŠน์ • ํŒŒ์ผ์„ staging area์— ์˜ฌ๋ฆฌ๊ธฐ git add [๋””๋ ‰ํ† ๋ฆฌ๋ช…] : ํ•ด๋‹น ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด์—์„œ ์ˆ˜์ •์‚ฌํ•ญ์ด ์žˆ๋Š” ๋ชจ๋“  ํŒŒ์ผ๋“ค์„ staging area์— ์˜ฌ๋ฆฌ๊ธฐ git add . : working d..

article thumbnail
์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค๋Š” ๋ณต์žกํ•ด,,
๋‚™์„œ 2021. 11. 1. 19:53

๋„ˆ๋ฌด๋‚˜ ํ•ด๋ณด๊ณ ์‹ถ์—ˆ๋˜ ์•ˆ๋“œ๋กœ์ด๋“œ์ž…๋‹ˆ๋‹ค. ์ˆ˜๊ฐ•์‹ ์ฒญ์„ ํ•ด์„œ ์ปค๋ฆฌํ˜๋Ÿผ์„ ๋”ฐ๋ผ๊ฐ€์ง€๋งŒ, java์˜ ๋ฒ ์ด์Šค๊ฐ€ ์—†์–ด์„œ์ธ์ง€๋Š” ๋ชฐ๋ผ๋„ ๋ฌธ๋ฒ•์—์„œ ๋‹ค์†Œ ๋‚œํ•ญ์„ ๊ฒช๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค... .xml ํŒŒ์ผ: soso ํฐ ํ‹€์„ ์ดํ•ดํ•˜๊ณ  ๋””์ž์ธ๋งŒ ์ž˜ ํ•ด์ฃผ๋ฉด ๋จ .java ํŒŒ์ผ: ๋ฌธ๋ฒ•์ด ๋‚œํ•ดํ•จ. class์˜ ๊ฐ ์‚ฌ์šฉ๋ฒ•์ด ๋„ˆ๋ฌด๋‚˜ ๋งŽ๋‹ค. ์ž๋ฐ” ์ค‘์ ์œผ๋กœ fragment๋“ค, activity๋“ค ๊ฐ„์˜ ๋ฐ์ดํ„ฐ ์†ก์ˆ˜์‹ ์—์„œ ๊ณต๋ถ€์ค‘-

[C++] ๋ณต์†Œ์ˆ˜๋ฅผ ๋‹ค๋ฃจ๋Š” class ๋งŒ๋“ค๊ธฐ

#include using namespace std; class Complex { private: double realNum_; double imaginaryNum_; public: void setValue(double r, double i) { realNum_ = r; imaginaryNum_ = i; } double getReal() { return realNum_; } double getImaginary() { return imaginaryNum_; } void print() { cout

[C++] ํ(Queue)๋ฅผ ์—ฐ๊ฒฐ๋ฆฌ์ŠคํŠธ๋กœ ๊ตฌํ˜„ํ•ด๋ณด์ž

ํ์˜ ์ •์˜ : ๋ฆฌ์ŠคํŠธ์˜ ํ•œ์ชฝ ๋์—์„œ๋งŒ ์‚ฝ์ž…๊ณผ ์‚ญ์ œ๊ฐ€ ์ผ์–ด๋‚˜๋Š” ์Šคํƒ๊ณผ๋Š” ๋‹ฌ๋ฆฌ ๋ฆฌ์ŠคํŠธ์˜ ํ•œ์ชฝ ๋์—์„œ๋Š” ์›์†Œ๋“ค์ด ์‚ญ์ œ๋˜๊ณ  ๋ฐ˜๋Œ€์ชฝ ๋์—์„œ๋Š” ์›์†Œ๋“ค์˜ ์‚ฝ์ž…๋งŒ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋งŒ๋“  ์ˆœ์„œํ™”๋œ ๋ฆฌ์ŠคํŠธ. ๊ฐ€์žฅ ๋จผ์ € ๋ฆฌ์ŠคํŠธ์— ์‚ฝ์ž…๋œ ์›์†Œ๊ฐ€ ๊ฐ€์žฅ ๋จผ์ € ์‚ญ์ œ๋˜๋ฏ€๋กœ ์„ ์ž… ์„ ์ถœ(ๅ…ˆๅ…ฅๅ…ˆๅ‡บ)์ธ FIFO(first in first out) ๋ฆฌ์ŠคํŠธ๋ผ๊ณ  ํ•œ๋‹ค. [๋„ค์ด๋ฒ„ ์ง€์‹๋ฐฑ๊ณผ] ํ [queue] (์ปดํ“จํ„ฐ์ธํ„ฐ๋„ทIT์šฉ์–ด๋Œ€์‚ฌ์ „, 2011. 1. 20., ์ „์‚ฐ์šฉ์–ด์‚ฌ์ „ํŽธ์ฐฌ์œ„์›ํšŒ) #include using namespace std; class LinkedList { private: class Node { public: int data; Node* next; }; Node* Head = new Node; Node* newNode = new Node; p..

article thumbnail
[๋ฐฑ์ค€][c] 10757๋ฒˆ: ํฐ ์ˆ˜ A+B

https://www.acmicpc.net/problem/10757 10757๋ฒˆ: ํฐ ์ˆ˜ A+B ๋‘ ์ •์ˆ˜ A์™€ B๋ฅผ ์ž…๋ ฅ๋ฐ›์€ ๋‹ค์Œ, A+B๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. www.acmicpc.net ๋ฌธ์ œ ๋‘ ์ •์ˆ˜ A์™€ B๋ฅผ ์ž…๋ ฅ๋ฐ›์€ ๋‹ค์Œ, A+B๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์ž…๋ ฅ ์ฒซ์งธ ์ค„์— A์™€ B๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (0 < A,B < 1010000) ์ถœ๋ ฅ ์ฒซ์งธ ์ค„์— A+B๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. #define _CRT_SECURE_NO_WARNINGS #include #include int i; //๋ฌธ์ž์—ด์„ ์ขŒ์šฐ ๋ฐ˜๋Œ€๋กœ ๋ฐ”๊ฟ”์คŒ. index์™€ ์ž๋ฆฟ์ˆ˜๋ฅผ ํ†ต์ผํ•˜๊ธฐ์œ„ํ•ด void ReverseStr(char str[]) { char tmp; for (i = 0; i < strlen(str) * (0.5); i++) {..

article thumbnail
[๋ฐฑ์ค€][c] 2839๋ฒˆ: ์„คํƒ• ๋ฐฐ๋‹ฌ

https://www.acmicpc.net/problem/2839 2839๋ฒˆ: ์„คํƒ• ๋ฐฐ๋‹ฌ ์ƒ๊ทผ์ด๋Š” ์š”์ฆ˜ ์„คํƒ•๊ณต์žฅ์—์„œ ์„คํƒ•์„ ๋ฐฐ๋‹ฌํ•˜๊ณ  ์žˆ๋‹ค. ์ƒ๊ทผ์ด๋Š” ์ง€๊ธˆ ์‚ฌํƒ•๊ฐ€๊ฒŒ์— ์„คํƒ•์„ ์ •ํ™•ํ•˜๊ฒŒ Nํ‚ฌ๋กœ๊ทธ๋žจ์„ ๋ฐฐ๋‹ฌํ•ด์•ผ ํ•œ๋‹ค. ์„คํƒ•๊ณต์žฅ์—์„œ ๋งŒ๋“œ๋Š” ์„คํƒ•์€ ๋ด‰์ง€์— ๋‹ด๊ฒจ์ ธ ์žˆ๋‹ค. ๋ด‰์ง€๋Š” 3ํ‚ฌ๋กœ๊ทธ www.acmicpc.net ๋ฌธ์ œ ์ƒ๊ทผ์ด๋Š” ์š”์ฆ˜ ์„คํƒ•๊ณต์žฅ์—์„œ ์„คํƒ•์„ ๋ฐฐ๋‹ฌํ•˜๊ณ  ์žˆ๋‹ค. ์ƒ๊ทผ์ด๋Š” ์ง€๊ธˆ ์‚ฌํƒ•๊ฐ€๊ฒŒ์— ์„คํƒ•์„ ์ •ํ™•ํ•˜๊ฒŒ Nํ‚ฌ๋กœ๊ทธ๋žจ์„ ๋ฐฐ๋‹ฌํ•ด์•ผ ํ•œ๋‹ค. ์„คํƒ•๊ณต์žฅ์—์„œ ๋งŒ๋“œ๋Š” ์„คํƒ•์€ ๋ด‰์ง€์— ๋‹ด๊ฒจ์ ธ ์žˆ๋‹ค. ๋ด‰์ง€๋Š” 3ํ‚ฌ๋กœ๊ทธ๋žจ ๋ด‰์ง€์™€ 5ํ‚ฌ๋กœ๊ทธ๋žจ ๋ด‰์ง€๊ฐ€ ์žˆ๋‹ค. ์ƒ๊ทผ์ด๋Š” ๊ท€์ฐฎ๊ธฐ ๋•Œ๋ฌธ์—, ์ตœ๋Œ€ํ•œ ์ ์€ ๋ด‰์ง€๋ฅผ ๋“ค๊ณ  ๊ฐ€๋ ค๊ณ  ํ•œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, 18ํ‚ฌ๋กœ๊ทธ๋žจ ์„คํƒ•์„ ๋ฐฐ๋‹ฌํ•ด์•ผ ํ•  ๋•Œ, 3ํ‚ฌ๋กœ๊ทธ๋žจ ๋ด‰์ง€ 6๊ฐœ๋ฅผ ๊ฐ€์ ธ๊ฐ€๋„ ๋˜์ง€๋งŒ, 5ํ‚ฌ๋กœ๊ทธ๋žจ 3๊ฐœ์™€ 3ํ‚ฌ๋กœ๊ทธ๋žจ 1..

article thumbnail
[๋ฐฑ์ค€][c] 5585๋ฒˆ: ๊ฑฐ์Šค๋ฆ„๋ˆ

https://www.acmicpc.net/problem/5585 5585๋ฒˆ: ๊ฑฐ์Šค๋ฆ„๋ˆ ํƒ€๋กœ๋Š” ์ž์ฃผ JOI์žกํ™”์ ์—์„œ ๋ฌผ๊ฑด์„ ์‚ฐ๋‹ค. JOI์žกํ™”์ ์—๋Š” ์ž”๋ˆ์œผ๋กœ 500์—”, 100์—”, 50์—”, 10์—”, 5์—”, 1์—”์ด ์ถฉ๋ถ„ํžˆ ์žˆ๊ณ , ์–ธ์ œ๋‚˜ ๊ฑฐ์Šค๋ฆ„๋ˆ ๊ฐœ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ์ ๊ฒŒ ์ž”๋ˆ์„ ์ค€๋‹ค. ํƒ€๋กœ๊ฐ€ JOI์žกํ™”์ ์—์„œ ๋ฌผ๊ฑด์„ ์‚ฌ www.acmicpc.net ๋ฌธ์ œ ํƒ€๋กœ๋Š” ์ž์ฃผ JOI์žกํ™”์ ์—์„œ ๋ฌผ๊ฑด์„ ์‚ฐ๋‹ค. JOI์žกํ™”์ ์—๋Š” ์ž”๋ˆ์œผ๋กœ 500์—”, 100์—”, 50์—”, 10์—”, 5์—”, 1์—”์ด ์ถฉ๋ถ„ํžˆ ์žˆ๊ณ , ์–ธ์ œ๋‚˜ ๊ฑฐ์Šค๋ฆ„๋ˆ ๊ฐœ์ˆ˜๊ฐ€ ๊ฐ€์žฅ ์ ๊ฒŒ ์ž”๋ˆ์„ ์ค€๋‹ค. ํƒ€๋กœ๊ฐ€ JOI์žกํ™”์ ์—์„œ ๋ฌผ๊ฑด์„ ์‚ฌ๊ณ  ์นด์šดํ„ฐ์—์„œ 1000์—” ์ง€ํ๋ฅผ ํ•œ์žฅ ๋ƒˆ์„ ๋•Œ, ๋ฐ›์„ ์ž”๋ˆ์— ํฌํ•จ๋œ ์ž”๋ˆ์˜ ๊ฐœ์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค. ์ž…๋ ฅ ์ž…๋ ฅ์€ ํ•œ์ค„๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ๊ณ , ํƒ€๋กœ๊ฐ€ ์ง€..