728x90
문제 2903번
https://www.acmicpc.net/problem/2903
문제를 보니까 2**input+1을 하면 한줄의 점 개수가 나온다. 그리고 그 점의 개수에 제곱을 해주면 점의 수를 구할 수 있다.
const readFileSyncAdress = process.platform === 'linux' ? '/dev/stdin':'./input.txt'
const input = require("fs").readFileSync(readFileSyncAdress).toString().trim();
const output = (2**input+1)**2;
console.log(output);
728x90
'백준 > JavaScript' 카테고리의 다른 글
[JS] 백준 약수, 배수와 소수 - 5086번 (0) | 2024.02.05 |
---|---|
[JS] 백준 일반 수학 1 - 다섯 번째 이야기 (0) | 2024.02.03 |
[JS] 백준 일반 수학 1 - 세 번째 이야기 (2) | 2024.02.01 |
[JS] 백준 일반 수학 1 - 두 번째 이야기 (0) | 2024.01.31 |
[JS] 백준 일반 수학 1 - 첫 번째 이야기 (0) | 2024.01.30 |