반응형
힙
-
백준 11279 최대힙 C++백준 algorithm 2022. 4. 2. 23:58
예제 입력 1 복사 13 0 1 2 0 0 3 2 1 0 0 0 0 0 예제 출력 1 복사 0 2 1 3 2 1 0 0 => 최대힙을 구현할 수 있는지에 대한 문제였습니ㅏㄷ. => C++에는 queue 헤더 안에 priority_queue 자료형을 사용 할 수 있습니다. => 해당 자료형을 이용해서 주어진 조건에 따라 출력문을 출력하면 되는 문제였습니다. => 시간초과가 걸릴 경우, cin.tie(0); ios_base::sync_with_stdio(false); 해당 구문을 입력해줄 경우 시간초과에 걸리지 않게 됩니다. #include #include #include #include #include #include #include #include #include using namespace std; i..