일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 자료구조
- cs
- 알고리즘
- 코테
- DP
- 오에스
- 북리뷰
- 구현
- Stack
- Computer science
- coding
- 백준
- 너비우선탐색
- 브루트포스
- 오퍼레이팅시스템
- 개발
- 정석학술정보관
- c++
- Operating System
- OS
- 코딩
- 문제풀이
- bfs
- 정석
- 컴퓨터공학과
- 컴공과
- 그래프
- 스택
- 컴공
- vector
- Today
- Total
목록큐 (2)
Little Jay
greedy한 문제였다 단순히 닭이 소의 시간 안에 들어있는지 아닌지를 파악해주면 되는 문제라 쉬워보였지만, 소를 priority queue로 정렬하는데에 있어서 시작시간만을 기준으로 정렬하면 틀리는 문제였다. priority queue의 정렬 함수를 구현하는 것이 결국 관건이었던 문제이다 #include #define endl '\n' using namespace std; int c, n; struct comp { bool operator()(pair a, pair b) { if (a.second != b.second) return a.second > b.second; return a.first > b.first; } }; vector chicken; priority_queue cow; int main..
#include #include using namespace std; class Node { public: int data; Node* next; Node(int data) { this->data = data; this->next = NULL; } }; class LinkedList { public: Node* f; Node* r; LinkedList() { f = NULL; r = NULL; } ~LinkedList() { } int front() { return f->data; } int end() { return r->data; } void addBack(int data) { Node* n = new Node(data); if (f == NULL) { f = r = n; } else { r->nex..