20250616 baekjoon javascript
This commit is contained in:
parent
1a4082657b
commit
2ca620b79e
6
code_study/Baekjoon/js/10101.js
Normal file
6
code_study/Baekjoon/js/10101.js
Normal file
@ -0,0 +1,6 @@
|
||||
const [a, b, c] = require("fs").readFileSync(0, "utf8").toString().trim().split('\n').map(Number);
|
||||
|
||||
if(a+b+c !== 180) console.log("Error");
|
||||
else if(a===b && a===c) console.log("Equilateral");
|
||||
else if(a===b || a===c || b===c) console.log("Isosceles");
|
||||
else console.log("Scalene");
|
||||
2
code_study/Baekjoon/js/1085.js
Normal file
2
code_study/Baekjoon/js/1085.js
Normal file
@ -0,0 +1,2 @@
|
||||
const n = require("fs").readFileSync(0, "utf8").toString().trim().split(' ').map(Number);
|
||||
console.log(Math.min(n[0],n[1],n[2]-n[0],n[3]-n[1]))
|
||||
4
code_study/Baekjoon/js/14215.js
Normal file
4
code_study/Baekjoon/js/14215.js
Normal file
@ -0,0 +1,4 @@
|
||||
const [a, b, c] = require("fs").readFileSync(0, "utf8").toString().trim().split(' ').map(Number);
|
||||
const [sum, max] = [a+b+c-Math.max(a,b,c), Math.max(a,b,c)]
|
||||
if(sum > max) console.log(sum+max);
|
||||
else console.log(2*sum-1);
|
||||
1
code_study/Baekjoon/js/15894.js
Normal file
1
code_study/Baekjoon/js/15894.js
Normal file
@ -0,0 +1 @@
|
||||
console.log(4*Number(require("fs").readFileSync(0, "utf8").toString().trim()));
|
||||
2
code_study/Baekjoon/js/27323.js
Normal file
2
code_study/Baekjoon/js/27323.js
Normal file
@ -0,0 +1,2 @@
|
||||
const [a, b] = require("fs").readFileSync(0, "utf8").toString().trim().split('\n').map(Number);
|
||||
console.log(a*b);
|
||||
10
code_study/Baekjoon/js/3009.js
Normal file
10
code_study/Baekjoon/js/3009.js
Normal file
@ -0,0 +1,10 @@
|
||||
const n = require("fs").readFileSync(0, "utf8").toString().trim().split('\n');
|
||||
let x=0, y=0;
|
||||
|
||||
for(let l of n) {
|
||||
let [a,b] = l.split(" ").map(Number);
|
||||
x ^= a;
|
||||
y ^= b;
|
||||
}
|
||||
|
||||
console.log(x,y);
|
||||
12
code_study/Baekjoon/js/5073.js
Normal file
12
code_study/Baekjoon/js/5073.js
Normal file
@ -0,0 +1,12 @@
|
||||
const n = require("fs").readFileSync(0, "utf8").toString().trim().split('\n');
|
||||
n.forEach(s => {
|
||||
let [a,b,c] = s.split(' ').map(Number);
|
||||
if(a===0 && b===0 && c===0) return;
|
||||
else{
|
||||
let sum = a + b + c - Math.max(a,b,c);
|
||||
if(sum<=Math.max(a,b,c)) console.log("Invalid");
|
||||
else if(a===b && a===c) console.log("Equilateral");
|
||||
else if(a===b || a===c || b===c) console.log("Isosceles");
|
||||
else console.log("Scalene");
|
||||
}
|
||||
});
|
||||
12
code_study/Baekjoon/js/9063.js
Normal file
12
code_study/Baekjoon/js/9063.js
Normal file
@ -0,0 +1,12 @@
|
||||
const n = require("fs").readFileSync(0, "utf8").toString().trim().split('\n');
|
||||
|
||||
let [min_x, min_y] = n[1].split(' ').map(Number);
|
||||
let [max_x, max_y] = [min_x, min_y];
|
||||
|
||||
n.slice(2).forEach( s => {
|
||||
let [x, y] = s.split(' ').map(Number);
|
||||
[min_x, min_y] = [Math.min(x, min_x), Math.min(y, min_y)];
|
||||
[max_x, max_y] = [Math.max(x, max_x), Math.max(y, max_y)];
|
||||
});
|
||||
|
||||
console.log((max_x-min_x)*(max_y-min_y));
|
||||
Loading…
x
Reference in New Issue
Block a user