이야기

  • 홈
  • 태그
  • 방명록

2025/03/12 2

백준 1931번 (Gold 5)

https://www.acmicpc.net/problem/1931정렬의 조건문을 잘 설정해야 하는 문제이다.#include #include #include #include using namespace std;int main() { std::vector > v; int N; cin >> N; for (int i = 0; i > first >> second; v.emplace_back(make_pair(first,second)); } std::sort(v.begin(), v.end(), [](std::pair l, std::pair r) { if (l.second == r.second) { if (l.first == l.second) return false; else if (r.first =..

백준 2025.03.12

백준 1744번(Gold 4)

https://www.acmicpc.net/problem/1744#include #include using namespace std;int main() { cin.tie(0)->sync_with_stdio(false); priority_queue> pq; priority_queue, greater> nq; int N; cin >> N; int sum = 0; for (int i = 0; i > tmp; if (tmp > 1) pq.push(tmp); else if (tmp 1) { int mul = nq.top(); nq.pop(); mul *= nq.top(); nq.pop(); sum += mul; } if (nq.size() == 1) sum += nq.top(); while (..

백준 2025.03.12
이전
1
다음
더보기
프로필사진

이야기

  • 분류 전체보기 (84)
    • 백준 (35)
    • c++ (14)
    • c# (0)
    • 인공지능 (0)
    • project (0)
    • unity (0)
    • html & css (1)
    • 정보보안기사 (2)
    • Algorithm (7)
    • MMOServer (25)

Tag

크기,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/03   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바