티스토리 뷰
https://www.acmicpc.net/problem/2935
2935번: 소음
수업 시간에 떠드는 두 학생이 있다. 두 학생은 수업에 집중하는 대신에 글로벌 경제 위기에 대해서 토론하고 있었다. 토론이 점점 과열되면서 두 학생은 목소리를 높였고, 결국 선생님은 크게
www.acmicpc.net
const input = require('fs')
.readFileSync('./dev/stdin')
.toString()
.trim()
.split('\n')
.map((v) => v.trim());
const a = input[0].length > input[2].length ? input[0] : input[2];
const b = input[0].length > input[2].length ? input[2] : input[0];
if (input[1] == '*') {
console.log(a + b.substring(1));
} else {
if (a.length == b.length) {
console.log(a.replace('1', '2'));
} else {
console.log(a.substring(0, a.length - b.length) + b);
}
}
728x90
'자료구조 알고리즘 > 백준' 카테고리의 다른 글
Node.js) 백준 11559번: Puyo Puyo (0) | 2023.07.08 |
---|---|
Node.js) 백준 17219번: 비밀번호 찾기 (0) | 2023.07.08 |
Node.js) 백준 15688번: 수 정렬하기 5 (0) | 2023.07.07 |
Node.js) 백준 11934번: 수 정렬하기 4 (0) | 2023.07.07 |
Node.js) 백준 2623번: 음악프로그램 (0) | 2023.07.07 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- create databases;
- 서버개발
- MOD
- 최소공통조상
- 은둔청년체험
- 서버점검
- 롱베케이션
- BFS
- DB 생성
- 그래프
- 투포인터 연습
- 개발자면접
- 동적프로그래밍
- 로드나인
- node.js
- MySQL
- 투포인터
- 다이나밍프로그래밍
- create db
- 면접질문
- 다이나믹프로그래밍
- 면접비
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함