티스토리 뷰
https://www.acmicpc.net/problem/30034
const input = require('fs')
.readFileSync('./dev/stdin')
.toString()
.trim()
.split('\n')
.map((v) => v.trim());
const n = +input[0];
const N = input[1].split(' ');
const m = +input[2];
const M = input[3].split(' ');
const k = +input[4];
const K = input[5].split(' ');
const s = +input[6];
const S = input[7];
const separators = new Set();
N.forEach((s) => {
separators.add(s);
});
M.forEach((s) => {
separators.add(s);
});
K.forEach((m) => {
separators.delete(m);
});
separators.add(' ');
const answer = [];
let str = '';
for (let i = 0; i < s; i++) {
const char = S[i];
if (separators.has(char)) {
if (str != '') {
answer.push(str);
str = '';
}
} else {
str += char;
}
}
if (str != '') {
answer.push(str);
}
console.log(answer.join('\n'));
728x90
'자료구조 알고리즘 > 백준' 카테고리의 다른 글
Node.js) 백준 30035번: Tier and Rank (0) | 2023.09.17 |
---|---|
Node.js) 백준 30036번: INK (0) | 2023.09.17 |
Node.js) 백준 30033번: Rust Study (0) | 2023.09.17 |
Node.js) 백준 29755번: 블랙홀과 소행성 (0) | 2023.09.17 |
Node.js) 백준 29754번: 세상에는 많은 유튜버가 있고, 그중에서 버츄얼 유튜버도 존재한다 (0) | 2023.09.17 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- MySQL
- 최소공통조상
- 동적프로그래밍
- 투포인터 연습
- DB 생성
- 면접질문
- 은둔청년체험
- create databases;
- 로드나인
- create db
- 서버점검
- 개발자면접
- 투포인터
- 다이나밍프로그래밍
- MOD
- 롱베케이션
- 서버개발
- node.js
- 다이나믹프로그래밍
- BFS
- 면접비
- 그래프
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함