언젠가는 펼쳐 볼 아카이브
[BOJ] 19532번 - 수학은 비대면강의입니다 본문
사용언어 : javascript - node.js
#문제
#제출코드
const fs = require('fs');
const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt';
const input = fs
.readFileSync(filePath)
.toString()
.split(' ')
.map((item) => +item);
solution(input[0], input[1], input[2], input[3], input[4], input[5]);
function solution(a, b, c, d, e, f) {
for (let i = -999; i <= 999; i++) {
for (let j = -999; j <= 999; j++) {
if (a * i + b * j === c && d * i + e * j === f) {
console.log(i, j);
return;
}
}
}
}
'IT > Baekjoon Oline Judge' 카테고리의 다른 글
[BOJ] 2231번 - 분해합 (0) | 2024.01.09 |
---|---|
[BOJ] 2798번 - 블랙잭 (0) | 2023.11.21 |
[BOJ] 24313번 - 알고리즘 수업 - 점근적 표기 1 (0) | 2023.10.12 |
[BOJ] 24267번 - 알고리즘 수업 (알고리즘의 수행 시간6) (0) | 2023.09.20 |
[BOJ] 24266번 - 알고리즘 수업 (알고리즘의 수행 시간5) (0) | 2023.09.20 |