[백준] 1744번 수 묶기
·
백준 문제/그리디
문제: 1744번: 수 묶기  #include #include #include #include #include #include #include #include #include #include // setprecision을 사용하기 위한 헤더using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; priority_queue, greater> nums; for (int i = 0; i > tmp; nums.push(tmp); } int sum = 0; while (nums.size() >= 2) { bool flag = nums.size() % 2 == 0 ? tr..
[백준] 11000 강의실 배정
·
백준 문제/그리디
문제: 11000번: 강의실 배정  #include #include #include #include #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; // 수업의 개수 cin >> n; vector> times; for (int i = 0; i > start >> end; pair tmp = make_pair(start, end); times.push_back(tmp); } // 시작 시점을 기준으로 정렬 sort(times.begin(), times.end()); // 최소힙으로 동작하도록.. priority_queue, g..
[백준] 1946번 신입 사원
·
백준 문제/그리디
보호되어 있는 글입니다.
[백준] 12904번 A와 B
·
백준 문제/그리디
보호되어 있는 글입니다.
[백준] 1541번 잃어버린 괄호
·
백준 문제/그리디
보호되어 있는 글입니다.
그리디 참고 자료
·
백준 문제/그리디
보호되어 있는 글입니다.
[백준] 1026번 보물
·
백준 문제/그리디
보호되어 있는 글입니다.
[백준] 11399번 ATM
·
백준 문제/그리디
보호되어 있는 글입니다.
[백준] 1715번 카드 정렬하기
·
백준 문제/그리디
보호되어 있는 글입니다.
[백준] 2217번 로프
·
백준 문제/그리디
보호되어 있는 글입니다.