๐Ÿ’› JavaScript/๋ฐฑ์ค€

๐Ÿ’› JavaScript/๋ฐฑ์ค€

    [JS] 10757

    const fs = require('fs'); const path = process.platform === 'linux' ? '/dev/stdin' : './data.txt'; const input = fs.readFileSync(path).toString().trim().split(' '); function solve(input) { let [A, B] = input.map((x) => BigInt(x)); return String(A + B); } console.log(solve(input)); ๋ฐฑ์ค€ ์ˆซ์ž๊ฐ€ ๋„ˆ๋ฌด ํด ๋•Œ, ์ œํ•œ์ด ์žˆ๋‹ค๋Š” ๊ฒƒ ex) 9223372036854775807์˜ ๊ฒฝ์šฐ 9223372036854776000์œผ๋กœ ๋‚˜..

    [JS] 2839

    const fs = require(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./data.txt&#39;; const input = Number(fs.readFileSync(path).toString().trim()); function solve(input) { let count = 0; if (input === 3) { return 1; } if (input < 5 || input === 7) { return -1; } for (let i = 0; i * 3 input) { console.log(-1); break; } count++; input -= 3; } ๋‹ค๋ฅธ ํ’€์ด

    [JS] 2775

    // 2 // 1 // 3 // 2 // 3 // ์ธต์€ 0์ธต๋ถ€ํ„ฐ, ํ˜ธ์ˆ˜๋Š” 1ํ˜ธ๋ถ€ํ„ฐ const fs = require('fs'); const path = process.platform === 'linux' ? '/dev/stdin' : './data.txt'; const input = fs .readFileSync(path) .toString() .trim() .split('\n') .map((x) => Number(x)); function solve(input) { const caseCount = input.shift(); for (let i = 0; i < caseCount; i++) { let kFloor = input.shift(); let nHosu = input.shift() - 1; // 1ํ˜ธ..

    [JS] 10250

    const fs = require(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./data.txt&#39;; const input = fs.readFileSync(path).toString().trim().split(&#39;\n&#39;); function solve(input) { let caseCount = Number(input[0]); for (i = 1; i Number(x)); let floor = 0; if (N % H === 0) { floor = H; } else { floor = N % H; } let ho = Math.ceil(N / H); if (ho < 1..

    [JS] 2869

    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๊ฐ€์ง€๋งŒ ์•Œ์•„์ฐจ..