전체 글 214

백준 c++ 14425 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/14425목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 실버 4 문제 입니다.문제명 : 문자열 집합많은 자료구조 중에서 빠른 문자열 탐색을 위한 자료구조를 사용해야 할 것 같았습니다.문제 알고리즘 분류에는 자료구조,문자열 말고도 해시나 트리등이 적혀 있었으나 아직 배우지 않았고, 사용하기까지 오래 걸릴 것 같았기 때문에 vector(이진탐색)를 사용하는 법을 찾아서 풀어보았습니다. 문자열을 저장하고 검사 문자열들을 하나씩 확인하며 포함되는지 체크했습니다.그리고 입출력 속도를 빠르게 하기 위해 특정 문자열을 사용했으며, endl보다는 '\n'을 사용했습니다. 내 코드#include #include #..

c++ 2025.05.12

백준 c++ 1620 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/1620목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 실버 4 문제 입니다.문제명 : 나는야 포켓몬 마스터 이다솜 내 코드#include #include #include #include using namespace std;int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; map intToString = map(); map stringToInt = map(); cin >> n >> m; for (int i = 1; i > name; intToS..

c++ 2025.05.11

백준 c++ 10815 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/10815목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 실버 5 문제 입니다.문제명 : 숫자 카드 내 코드#include #include #include #include #include using namespace std;int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; vector cards(n); for (int i = 0; i > cards[i]; } sort(cards.begin(), cards.end()); int m; ..

c++ 2025.05.10

백준 c++ 18258 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/18258목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 실버 4 문제 입니다.문제명 : 큐 2 내 코드#include#include#include#include#include using namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(NULL); std::cout.tie(NULL); int n; cin >> n; queue que; string cmd; int x; while (n--) { cin >> cmd; if (cmd == "push") { cin >> x; que.push(x); } else if..

c++ 2025.05.08

백준 c++ 9012 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/9012목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 실버 4 문제 입니다.문제명 : 괄호 내 코드#include#include#include#includeusing namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(NULL); std::cout.tie(NULL); int n; cin >> n; while (n--) { string input; cin >> input; stack stack; bool isTrue = false; if (input.length() % 2 != 0) { cout 0..

c++ 2025.05.07

백준 c++ 14724 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/14724목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 브론즈 2 문제 입니다.문제명 : 관리자는 누구? 내 코드#include#include#include#includeusing namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(NULL); std::cout.tie(NULL); int n; cin >> n; string clubs[9] = { "PROBRAIN", "GROW", "ARGOS", "ADMIN", "ANT", "MOTION", "SPG", "COMON", "AL..

c++ 2025.05.01
728x90