Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
Tags
- suspense react-query
- ์ฌ์ฉ์ฑ ๊ฐ์
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- ๊ตฌ๋ฆํค
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- emotion RSC
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- next13 emotion
- js ๋ฌธ์์ด ์์ถ
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- ๋ฐฑ์ค 1339๋ฒ nodejs
- suspense ๋์์๋ฆฌ
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- js
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- app router emotion
- js ์ค์ฝํ
- ์ค์ฝํ
- ์นด์นด์ค ์ฝํ
- ๋ฐฑ์ค 2108 nodejs
- emtion app router
- ๋ฐฑ์ค 1339๋ฒ js
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- suspense ๋ณ๋ชฉํ์
- suspense ๋น๋๊ธฐ
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ์ต์ ๋์ฒด์ด๋
Archives
- Today
- Total
Lennon FE
[๋ฐฑ์ค 11399๋ฒ] ATM - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) ๋ณธ๋ฌธ
๐ฅ Algorithm/Baekjoon
[๋ฐฑ์ค 11399๋ฒ] ATM - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs)
Lennon 2022. 1. 21. 22:42728x90
๋ฐ์ํ
https://www.acmicpc.net/problem/11399
const fs = require('fs');
let input = fs.readFileSync('dev/stdin').toString().trim().split('\n');
const len = +input.shift();
input = input[0]
.split(' ')
.map(Number)
.sort((a, b) => a - b);
//์
๋ ฅ๊ฐ ์กฐ์
//ํ์ด
let answer = 0;
for (let i = 0; i < len; i++) {
const minute = input.reduce((prev, cur) => prev + cur, 0);
answer += minute;
input.pop();
}
console.log(answer);
๊ฐ๋จํ๊ฒ reduce, pop์ ์ด์ฉํด ํ ์ ์๋ ๋ฌธ์ ์ด๋ค.
์๊ฒ๋ ๊ฒ - ๋งค๋ฒ map์ ์ฌ์ฉํด ๋ฌธ์์ด์ ์ซ์๋ก ๋ฐ๊ฟ ๋ map( v=> +v)์ ์ฌ์ฉํ์๋๋ฐ ๊ฐ๋จํ๊ฒ map(Number)์ ์ฌ์ฉํด๋ ๋๋ค.
728x90
๋ฐ์ํ
'๐ฅ Algorithm > Baekjoon' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค 11047๋ฒ] ๋์ 0 - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.01.23 |
---|---|
[๋ฐฑ์ค 1026๋ฒ] ๋ณด๋ฌผ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.01.21 |
[๋ฐฑ์ค 1946๋ฒ] ์ ์ ์ฌ์ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.01.21 |
[๋ฐฑ์ค 1747๋ฒ] ์์&ํฐ๋ฆฐ๋๋กฌ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.01.21 |
[๋ฐฑ์ค 16917๋ฒ] ์๋ ๋ฐ ํ๋ผ์ด๋ ๋ฐ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.01.21 |
Comments