diff --git a/ABC451/daehee/A.cpp b/ABC451/daehee/A.cpp new file mode 100644 index 0000000..b67dadb --- /dev/null +++ b/ABC451/daehee/A.cpp @@ -0,0 +1,19 @@ +#include +using namespace std; + +void solve() { + string s; + cin >> s; + + if (s.size() % 5) cout << "No"; + else cout << "Yes"; + return; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); + cout.tie(0); + + solve(); +} \ No newline at end of file diff --git a/ABC451/daehee/B.cpp b/ABC451/daehee/B.cpp new file mode 100644 index 0000000..706c7a5 --- /dev/null +++ b/ABC451/daehee/B.cpp @@ -0,0 +1,26 @@ +#include +using namespace std; + +void solve() { + int N, M; cin >> N >> M; + vector> cnt(M+1, {0, 0}); + for (int i=1 ; i<=N ; i++) { + int a, b; + cin >> a >> b; + ++cnt[a].first; + ++cnt[b].second; + } + + for (int i=1 ; i<=M ; i++) { + auto [a, b] = cnt[i]; + cout << b-a << "\n"; + } +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); + cout.tie(0); + + solve(); +} \ No newline at end of file diff --git a/ABC451/daehee/C.cpp b/ABC451/daehee/C.cpp new file mode 100644 index 0000000..c32ece8 --- /dev/null +++ b/ABC451/daehee/C.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; + +void solve() { + int Q; cin >> Q; + priority_queue, greater<>> pq; + + while (Q--) { + int q, h; cin >> q >> h; + if (q == 1) { + pq.push(h); + } + + if (q == 2) { + while (!pq.empty() && pq.top() <= h) pq.pop(); + } + + cout << pq.size() << "\n"; + } +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); + cout.tie(0); + + solve(); +} \ No newline at end of file