알고리즘74 백준 1541번 : 잃어버린 괄호 문제 링크 : www.acmicpc.net/problem/1541 내 풀이(2021.1.10) : #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string str; cin >> str; int result = 0; int idx = 0; bool minus = false; bool first = true; int i = 0; for (; i < str.size(); i++) { if (str[i] != '+' && str[i] != '-') continue; if (!minus && str[i]=='+') { result += stoi(str.. 2021. 1. 10. 백준 1931번 : 회의실 배정 문제 링크 : www.acmicpc.net/problem/1931 내 풀이(2021.1.9.) : #include #include #include using namespace std; deque dq; bool comp(pair a, pair b) { if (a.second == b.second) return a.first > N; for (int i = 0; i > a >> b; dq.push_back(make_pa.. 2021. 1. 9. 백준 11047번 : 동전 0 문제 링크 : www.acmicpc.net/problem/11047 내 풀이(2021.1.8.) : #include using namespace std; int money[10]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N, K; cin >> N >> K; for (int i = 0; i > money[i]; } int cnt = 0; for (int i = N - 1; i >= 0; i--) { while (K - money[i] >= 0) { K -= money[i]; cnt++; } } cout 2021. 1. 8. 백준 1904번 : 01타일 문제 링크 : www.acmicpc.net/problem/1904 풀이에 참고한 링크 : lollolzkk.tistory.com/5 내 풀이(2021.1.7.) : #include using namespace std; int cache[1000000 + 1]; int search(int rest) { if (rest 0) { if (cache[rest] != 0) { // 캐시에 값이 존재하면 return cache[rest]; } else { // 캐시에 값이 존재하지 않으면 int temp = search(rest - 2) + search(rest - 1); if (temp >= .. 2021. 1. 7. 이전 1 ··· 10 11 12 13 14 15 16 ··· 19 다음