c++ 14226번 이모티콘 (백준)
#include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int s, ans = 1e9; cin >> s; queue q; q.push(make_tuple(1, 1, 1)); bool v[1001] = {}; //방문확인 while(!q.empty()) { //bfs int now = get(q.front()); int copy = get(q.front()); int value = get(q.front()); q.pop(); if(now == s) { //원하는 개수로 맞추었다면 탐색 종료 ans = value; break; } value++; //수행시간 1 증가 if(now 2) q.push(make_tupl..
c++/BAEKJOON
2023. 10. 6. 05:22
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 스택
- 누적합
- 그리디
- C++
- DFS
- 덱
- 오프라인 쿼리
- Krustal
- 백준
- DP
- 카드
- java
- 1835
- C언어
- 16120번
- 6198번
- Mo.s
- 플로이드
- 1835번
- 정렬
- 그래프
- union
- 최대공약수
- 누적 합
- 세그먼트 트리
- 트리
- find
- BFS
- 최소 스패닝 트리
- 6198
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
글 보관함