diff --git a/week11/wonkyDD/.gitkeep b/week11/wonkyDD/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/week11/wonkyDD/11000.cpp b/week11/wonkyDD/11000.cpp new file mode 100644 index 0000000..1370e20 --- /dev/null +++ b/week11/wonkyDD/11000.cpp @@ -0,0 +1,37 @@ +#include +#include +#include +#include +using namespace std; +using pii = pair; + +int N; +vector v; +priority_queue, greater> pq; + +int main() { + ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); + + cin >> N; + int s,t; + for (int i=0; i> s >> t; + v.push_back({s, t}); + } + // NOTE : 수업의 시작 시간을 기준으로 오름차순 정렬한다 + sort(v.begin(), v.end()); + + // NOTE : 첫번째 수업은 강의실에 넣고 시작 + pq.push(v[0].second); + + for (int i=1; i= 현재 수업 끝나는 시간) + if (v[i].first >= t) pq.pop(); + pq.push(v[i].second); + } + + // NOTE : 큐에서 pop되지 못하고 남아있는 끝나는 시간 개수만큼 답이다 + cout << pq.size(); + return 0; +} diff --git a/week11/wonkyDD/15686.cpp b/week11/wonkyDD/15686.cpp new file mode 100644 index 0000000..d5431ba --- /dev/null +++ b/week11/wonkyDD/15686.cpp @@ -0,0 +1,62 @@ +#include +#include +#include +using namespace std; +#define MAX 13 +using pii = pair; +struct pos { + int y; int x; +}; +vector home, chicken; +vector choose; + +bool check[MAX]; + +int N,M; +int ans = INT_MAX; + +int dist(const pos& p1, const pos& p2) { + return abs(p1.y - p2.y) + abs(p1.x - p2.x); +} + +int cal() { + int sum = 0; + for (int i=0; i> N >> M; + for (int i=0; i> t; + if (t == 1) home.push_back({i, j}); + else if (t == 2) chicken.push_back({i, j}); + } + } + dfs(0, 0); + cout << ans; + return 0; +} \ No newline at end of file