개발일지

  • 홈
  • 태그
  • 방명록

11286 1

[백준] 11286 절댓값 힙 with C++

문제설명 입출력 예제 개념 우선순위 큐의 정렬 순서를 직접 지정하면 풀 수 있는 문제다. 구조체를 이용하여 연산자를 오버로딩하여도 되고, 단순히 비교 함수를 인자로 추가해도 된다. 풀이 #include #include #include using namespace std; bool abs_operator(int a, int b) { return abs(a) == abs(b) ? a > b : abs(a) > abs(b); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, n; priority_queue pq(abs_operator); cin >> N; while (N--) { cin >> n; if (n == 0) { if (pq.e..

Algorithm/백준 2023.05.23
이전
1
다음
더보기
프로필사진

게임 및 개발에 대한 일지

  • 분류 전체보기 (275)
    • CS (100)
      • 자료구조 (20)
      • 알고리즘 (14)
      • 컴퓨터구조 (12)
      • 컴퓨터비전 (1)
      • 데이터베이스 (4)
      • 딥러닝 (6)
      • 마이크로프로세서 (17)
      • 디지털영상처리 (21)
      • 임베디드 (3)
      • 통신 (2)
    • Language (40)
      • C++ (24)
      • Python (8)
      • C (3)
      • C# (5)
    • Game (21)
      • LostArk (4)
      • Unity (17)
    • Algorithm (100)
      • 백준 (75)
      • 프로그래머스 (25)
    • Version (4)
      • Git (4)
    • Program (7)
      • TeamCreator (1)
      • Dictionary (3)
      • Arduino (1)
      • Raspberry Pi (1)
    • Develope (2)

Tag

그리디, DIGITAL IMAGE PROCESSING, stack, 문자열, 정렬, 마이크로컴퓨터, 마이크로프로세서, 유니티, 자료구조, 디지털 영상 처리, 알고리즘, unity, Cpp, Algorithm, 프로그래머스, 백준, DIP, Python, String, C++,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바