https://github.com/kingjaeyeon/backzun
알고리즘 연습
https://github.com/kingjaeyeon/backzun
Last synced: about 1 month ago
JSON representation
알고리즘 연습
- Host: GitHub
- URL: https://github.com/kingjaeyeon/backzun
- Owner: KingJaeYeon
- Created: 2024-09-21T15:58:03.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-12-27T03:31:51.000Z (6 months ago)
- Last Synced: 2025-02-17T11:35:56.455Z (4 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
https://help.acmicpc.net/language/info
//입력값이 하나일 경우(숫자)
//input: 8
//output: 8
const input = +require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim();//입력값이 띄어쓰기로 구분된 한 줄의 값들인 경우(문자)
//input: hello world
//output: ['hello', 'world']
const input = require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim()
.split(" ");//입력값이 띄어쓰기로 구분된 한 줄의 값들인 경우(숫자)
//input: 8 7 56
//output: [8, 7, 56]
const input = require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim()
.split(" ")
.map(Number);// 입력값이 여러 줄의 값들인 경우(문자)
//input:
//a
//b
//c
//d
//output: ['a', 'b', 'c', 'd']
const input = require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim()
.split("\n");// 입력값이 여러 줄의 값들인 경우(숫자)
//input:
//1
//2
//3
//4
//5
//output: [1, 2, 3, 4, 5]
const input = require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim()
.split("\n")
.map(Number);// 입력값이 여러 줄의 값들이 띄어쓰기로 구분되어 있는 경우(문자)
//input:
//ab cd
//ef gh
//my name is minjoon
//hi hello
//output: [
// [ 'ab', 'cd' ],
// [ 'ef', 'gh' ],
// [ 'my', 'name', 'is', 'minjoon' ],
// [ 'hi', 'hello' ]
//]
const input = require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim()
.split("\n")
.map((el) => el.split(" "));// 입력값이 여러 줄의 값들이 띄어쓰기로 구분되어 있는 경우(모두 숫자)
//input:
//3
//1 2
//3 4 5 6
//5 3 2 5
//0 1 1 0
//output: [ [ 3 ], [ 1, 2 ], [ 3, 4, 5, 6 ], [ 5, 3, 2, 5 ], [ 0, 1, 1, 0 ] ]
const input = require("fs")
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
.toString()
.trim()
.split("\n")
.map((el) => el.split(" ").map(Number));