const fs = require('fs');
const path = process.platform === 'linux' ? '/dev/stdin' : './data.txt';
const input = fs
.readFileSync(path)
.toString()
.split(' ')
.map((x) => Number(x));
function solve(input) {
const [A, B, V] = input;
let answer = Math.ceil((V - B) / (A - B));
return answer;
}
console.log(solve(input));
python ๋ ํค๋งธ๋ ๊ฒ ๊ธฐ์ต๋๋ ๋ฌํ์ด ๋ฌธ์
๋จ์ํ ์ํ์ผ๋ก ๋ถ๋ฑ์์ ์ธ์ฐ๊ณ ๊ทธ์ ๋ฐ๋ฅธ ๋ฐ๋ณต๋ฌธ์ ์๊ฐํ๊ธฐ ๋ง๋ จ์ธ๋ฐ, 2๊ฐ์ง๋ง ์์์ฐจ๋ฆฌ๋ฉด ๋๋ค.
- ๋ฌํ์ด๊ฐ ์ ์์ ๋๋ฌํ๋ ์๊ฐ์ ๊ฒฐ๊ตญ ์ฌ๋ผ๊ฐ๋ ๋๋ผ๋ ์ => ์ฌ๋ผ๊ฐ๋ ํ์๊ฐ ๋ด๋ ค๊ฐ๋ ํ์๋ณด๋ค 1๋ฒ ๋ง์ ์ ๋ฐ์ ์๋ค.
- ๋ถ๋ฑ์์ ์ธ์๋ณธ ๋ค์, ์๋ฆฌ์กฐ๋ฆฌ ์ฎ๊ฒจ์ ๊ทธ๋์ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์ด๋ป๊ฒ ํ๋ฉด ๋ฐ๋ณต๋ฌธ์ ์์ธ ์ ์๋์ง ์๊ฐํด๋ณด๊ธฐ
์ด๋ฒ์ ์ฝ๊ฒ ํ ์ ์์๋ค. :)
'๐ JavaScript > ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[JS] 2775 (0) | 2022.05.21 |
---|---|
[JS] 10250 (0) | 2022.05.19 |
[JS] 1193 (0) | 2022.05.18 |
[JS] 2292 (0) | 2022.05.18 |
[JS] 1712 (0) | 2022.05.18 |