[5948] : ์์์ด์ 7-3-5 ๊ฒ์ ์ ๋ ฅ : 7๊ฐ์ ์๋ก ๋ค๋ฅธ ์ ์ ์ถ๋ ฅ : 7๊ฐ์ ์ ์ ์ค 3๊ฐ์ ์์ ํฉ ์ค 5๋ฒ์งธ๋ก ํฐ ์ ์ ๋ต ์ฃผ์ด์ง๋ ์ ๋ ฅ์ด 7๊ฐ์ ์ ์์ด๋ฏ๋ก ๋ง๋ค ์ ์๋ ํฉ์ ์กฐํฉ์ 35๊ฐ ๋ด๋ฆผ ์ฐจ์์ผ๋ก ์ ๋ ฌ์ ํ๊ณ 5๋ฒ์งธ๋ก ํฐ ์๋ฅผ ๊ตฌํ๋ค (ํฉ์ ๊ฐ์ ์ ์์ (5 + 6 + 7) = (4 + 5 + 9) ์ฒ๋ผ) #include #include using namespace std; bool descend(int, int); int fifthLargeNum(int *); int main(void){ int testCase, sevenNums[7], sumSet[35]; cin >> testCase; for(int tc = 1; tc > sevenNums[i]; for(int x = 0;..
[6190] : ์ ๊ณค์ด์ ๋จ์กฐ ์ฆ๊ฐํ๋ ์ ์ ๋ ฅ : N๊ฐ์ ์ ์ → ๊ฐ๋ฅํ ๊ณฑ์ ์กฐํฉ์ ์์๋ณด๋๊น ๊ณ์ ๋ ์ธ๋ฑ์ฑ์ด ํ์ํ๋ฏ๋ก ๋ฒกํฐ๋ณด๋ค๋ ๋ฐฐ์ด์ด ๋ ์ ํฉ ์ถ๋ ฅ : ๋จ์กฐ์ฆ๊ฐ ์ ์ค ๊ฐ์ฅ ํฐ ๊ณฑ์ ์กฐํฉ (์์ผ๋ฉด -1) ์ ๋ต ๋จ์กฐ ์ฆ๊ฐํ๋ ์ ํ๋ณ ๋ฒ : 10์ผ๋ก ๋๋์ด๋ณด์์ ๋ ์ง์ ๋๋จธ์ง๊ฐ ํ์ฌ ๋๋จธ์ง๋ณด๋ค ์ปค์ผ ํจ 10๋ณด๋ค ์์ ์๋ ๋จ์กฐ ์ฆ๊ฐ๋ก ํ๋จํ๋ฏ๋ก do-while ์ฌ์ฉ #include using namespace std; bool isItIncreasingNum(int); int main(void){ int testCase; cin >> testCase; for(int tc = 1; tc > N; int *numArr = new int[..
[6730] : ์ฅ์ ๋ฌผ ๊ฒฝ์ฃผ ๋์ด๋ ์ ๋ ฅ : ๋ธ๋ก์ ๋์ด๋ค → ๊ณ ์ ๋ ๊ฐ์ด๊ณ , ์ฝ์ ์ญ์ ๊ฐ ์ผ์ด๋์ง ์์ ์์ ์ด๋ฏ๋ก ๋ฐฐ์ด(: blocks)์ ์ฌ์ฉ ์ถ๋ ฅ : 1) ์ฌ๋ผ๊ฐ ๋ ๊ฐ์ฅ ์ฌํ ๋์ด ๋ณํ 2) ๋ด๋ ค๊ฐ ๋ ๊ฐ์ฅ ์ฌํ ๋์ด ๋ณํ ์ ๋ต blocks[i - 1]๊ณผ blocks[i]๋ฅผ ๋น๊ตํด์ up์ธ์ง down์ธ์ง ํ๋ณ ๋ฐฉ๊ธ ๋น๊ตํ up / down์ด maxUp / maxDown ๋ณด๋ค ํฐ์ง ํ๋ณํด์ ์ ๋ฐ์ดํธ #include using namespace std; int main(void){ int testCase; cin >> testCase; for(int t = 0; t > blockCount; // blo..
์ฐ์ฐ์๋ ๋ค๋ฅธ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด๋ค์์๋ ๋ฐฐ์ฐ๋์ง๋ผ ํฌ๊ฒ ์ค๋ช ํ๋ฉด์ ๋ค๋ฃฐ ๊ฒ์ ์์ ๊ฒ ๊ฐ๊ณ , ์ฒ์๋ณด๊ฑฐ๋, ํท๊ฐ๋ฆฌ๊ฑฐ๋ ์ ์ฐ์ง ์์๋ ๊ธฐ๋ณธ ์ฐ์ฐ์๋ค์ ๋์ด์์ผ๋ก ์ง์ด๋ณผ๊นํ๋ค. 1. Unary Minus Operator let five = 5 let minusFive = -five 2. Identity Operators JS๋ PHP์ ์ด๋ฐ๊ฒ ์๋ค๊ณ ํ๋ก๊ทธ๋๋ฐ์ธ์ด๋ก ํ ๋ ์ ๊น ๋ณด๊ธด ํ์๋๋ฐ ์จ๋ณด์ง ๋ชปํ๋ identity operator์ธ === ์ !==. ์์/๋ณ์๋ค์ด ์ ํํ ๊ฐ์ instance๋ฅผ ๊ฐ๋ฅดํค๊ณ ์๋์ง ์์๋ณผ ๋ ์ฐ๋ ์ฐ์ฐ์๋ค. 3. Comparison Operator ๋น๊ต ์ฐ์ฐ์์ ๋ํด ํ ๋ง์ด ์๋ ๊ฒ์ ์๋๊ณ string, tuple์ ๋น๊ต๋ฅผ ์ฐ์ฐ์๋ก ํ ์ ์๋ค๋ ๊ฒ์ ์ ๊ณ ์ถ์๋ค. /..
Types Swift๋ ์๋ฃํ์ ์ฌํ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด๋ค ์ฒ๋ผ ๊ธฐ๋ณธ์ ์ธ ์๋ฃํ๊ณผ collection type์ ์ ๊ณตํ๋ค. ๊ทธ ๋ฐ์๋ Objective-C์์๋ ์ ๊ณตํ์ง ์์ง๋ง python์ ๋ค๋ค๋ดค๋ค๋ฉด ์๋ tuple๊ณผ Swift์ ๊ฐ์ฅ ๊ฐ๋ ฅํ ๋๊ตฌ์ธ optional์ด ์๋ค. Swift์์ ๋ณผ ์ ์๋ ๊ธฐ๋ณธ์ ์ธ ์๋ฃํ์๋ ์ ์๋ฅผ ๋ํ๋ด๋ Int, ์ค์๋ฅผ ๋ํ๋ด๊ธฐ ์ํ Double / Float, ๋ ผ๋ฆฌ ์๋ฃํ Bool๊ณผ text data๋ฅผ ์ํ String์ด ์๋ค. Collection type์๋ Array, Set, Dictionary๊ฐ ์๊ณ ์ง์ ์ ์ธ๊ธํ tuple์ ํจ์์์ ์ฌ๋ฌ ๊ฐ์ returnํ๊ณ ์ถ์ ๋ ์ฌ์ฉํ ์ ์๋ค. ๊ฐ์ฅ ๊ฐ๋ ฅํ ์๋ฃํ์ธ optional type์ ์ฌ์ฉํ๋ฉด ๊ฐ์ ์ ๋ฌด๋ฅผ ํํํ ..
์ด ๊ธ์ Vector์ Array ์ ๋ํด ๋ค๋ฃจ๊ฒ ์ต๋๋ค. ์ ์ฒด์ ์ธ ๋ด์ฉ์ eduCBA, cplusplus.com ๋ฑ์ ์ ๋ฆฌํ์ต๋๋ค. ๊ณต๋ถํ ๊ฒ์ ์ ๋ฆฌํ๋ ํ์์ผ๋ก ์์ฑ๋์์ผ๋ฏ๋ก ์ค๋ฅ๊ฐ ์์ ์ ์์ต๋๋ค. ์ค๋ฅ ๋ฐ๊ฒฌ์ ๋๊ธ๋ก ๊ผญ ๋ง์ํด์ฃผ์ธ์! ์์ํด๋ณผ๊น์? ์๊ณ ๋ฆฌ์ฆ ๋ฌธ์ ๋ฅผ ํ๋ค๋ณด๋ฉด ๋์ ์ผ๋ก ์์๋ค์ ๋ฃ์๋ค ๋บ๋ค ํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง๊ธฐ ๋๋ฌธ์ ๊ฑฐ์ ๋ฌด์กฐ๊ฑด์ ์ผ๋ก vector๋ฅผ ์ฐ๊ณค ํฉ๋๋ค. ๊ทธ๋๋ ์๊ฐํด ๋ณด๋ฉด ๋ฐฐ์ด์ ๋ ์์ฃผ ์ฐ์ง ์๋ ๊ฒ์ ๋ ์๋๋๋ค. ๋ํ๊ต์์ ์ํ์ ๋ณด๊ธฐ ์ํด์ ๊ณต๋ถ ํ๋ ๋น์ vector๋ ์๋ฃ ์ ๊ทผ์ ์์ฃผ ํ ๋ ์ฐ์ง ์๋ ๊ฒ์ด ์ข๋ค๊ณ ํ๋ ๊ธฐ์ต์ด ์์ฃผ ์ด๋ ดํ์ด ์๋๋ฐ ๊ทธ๋๋ ๋๋ ทํ ๊ตฌ๋ถ์ ํ ํ์์ฑ์ ๋๋๋๋ค. (์ฌ์ค ํ๋ก๊ทธ๋๋จธ์ค์ ์ด ๋ชจ์๊ณ ์ฌ ๋ฌธ์ ๋ ๋ฐฐ์ด๋ก ํ์์ด๋ ํฐ ๋ฌด๋ฆฌ๋ ์์์ ..
[1970] : ์ฌ์ด ๊ฑฐ์ค๋ฆ๋ #include using namespace std; void getChange(int); int main(void){ int testCase; cin >> testCase; for(int test = 0; test > changeM; getChange(changeM); } return 0; } void getChange(int money){ int mType[8]{0,}; int static trial = 1; while(money > 9){ if(money >= 50000){ mType[0] += 1; money -= 50000; } else if(money >= 10000){ mType[1] += 1..
[1859] : ๋ฐฑ๋ง ์ฅ์ ํ๋ก์ ํธ #include using namespace std; int main(void) { int testCase; int day; cin >> testCase; long * ans = new long[testCase]; for (int i = 0; i > day; long * price = new long[day]; long total = 0; for (int j = 0; j > price[j]; long max = price[day - 1]; for (int j = day - 2; j > -1; j--) if (price[j] < max) total += (max - price[j]); else ma..
[1285] : ์๋ฆ์ด์ ๋ ๋์ง๊ธฐ #include #include using namespace std; vector distAns; vector cntAns; void printAnswer(int); // output int getDistance(int*, int); int getCount(int*, int, int); int main(void){ int testCase; cin >> testCase; for(int test = 0; test > N; int * dist = new int[N]; for(int i = 0; i > dist[i]; if(dist[i] < 0) // ์์ ์ชฝ์ ..
[1986] : ์ง๊ทธ์ฌ๊ทธ ์ซ์ #include #include #include using namespace std; vector answer; void printAnswer(int); int main(void){ int testCase; cin >> testCase; for(int test = 0; test > num; for(int n = 1; n < num + 1; n++){ if(n % 2 == 0) sum -= n; else sum += n; } answer.push_back(sum); } printAnswer(testCase); return 0; } void printAnswer(int testCase){ for(in..
- Total
- Today
- Yesterday
- ์ํํธ์จ์ด์์นด๋ฐ๋ฏธ
- firebase
- swacademy
- ios
- ๋ถ์คํธ์บ ํ2020
- C++
- ์ปด๊ณผ์กธ์
- ์ํํธ์จ์ด์ญ๋์ํ
- ์ปด๊ณต์กธ์
- ๋ถ์บ
- ์ปค๋ฅํธ์ฌ๋จ
- ์กธ์ ์ํ
- ๋ณด์
- ์ด์์ฒด์
- ์ฝํ
- RxSwift
- ์ผ์ฑ
- ์ฝ๋ฉํ ์คํธ
- ์ปดํจํฐ๊ณตํ
- ๊ฐ๋ฐ์์ธํด
- ์๊ณ ๋ฆฌ์ฆ
- ๋ถ์คํธ์บ ํ
- ํ๋ก๊ทธ๋๋จธ์ค
- nosql
- ์ธํด
- TableView
- SWIFT
- ๋ฐ์ดํฐ๋ถ์
- ์ผ์ฑ์ํํธ์จ์ด์์นด๋ฐ๋ฏธ
- OS
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |