diff --git a/atcoder/abc091/A/main.cpp b/atcoder/abc091/A/main.cpp new file mode 100644 index 00000000..f9fa3c73 --- /dev/null +++ b/atcoder/abc091/A/main.cpp @@ -0,0 +1,17 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + int A, B, C; + cin >> A >> B >> C; + auto ans = (A + B >= C) ? "Yes" : "No"; + cout << ans << endl; + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc091/B/main.cpp b/atcoder/abc091/B/main.cpp new file mode 100644 index 00000000..cbc09ab6 --- /dev/null +++ b/atcoder/abc091/B/main.cpp @@ -0,0 +1,34 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + int N, M; + string s; + + map netp; + + cin >> N; + for (int i = 0; i < N; ++i) { + cin >> s; + netp[s]++; + } + cin >> M; + for (int i = 0; i < M; ++i) { + cin >> s; + netp[s]--; + } + + int maxp = 0; + for (auto const& e : netp) { + maxp = max(maxp, e.second); + } + cout << maxp << endl; + + return 0; +} \ No newline at end of file diff --git a/atcoder/abc091/C/main.cpp b/atcoder/abc091/C/main.cpp new file mode 100644 index 00000000..d9a7ccfb --- /dev/null +++ b/atcoder/abc091/C/main.cpp @@ -0,0 +1,50 @@ +#include + +using namespace std; +using ll = int64_t; +using ff = long double; + +int N; +vector> rs, bs; + +int solve() { + // x asc, y asc + sort(bs.begin(), bs.end()); + // y desc x desc + sort(rs.begin(), rs.end(), [](auto const& lhs, auto const& rhs) { + if (lhs.second != rhs.second) return lhs.second > rhs.second; + return lhs.first > rhs.first; + }); + + int count = 0; + vector used(N, false); + for (int i = 0; i < N; ++i) { + for (int j = 0; j < N; ++j) { + if (used[j]) continue; + if (bs[i].first <= rs[j].first) continue; + if (bs[i].second <= rs[j].second) continue; + used[j] = true; + ++count; + break; + } + } + return count; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(0); cout.tie(0); + + cin >> N; + rs.assign(N, { 0, 0 }); + bs.assign(N, { 0, 0 }); + for (int i = 0; i < N; ++i) { + cin >> rs[i].first >> rs[i].second; + } + for (int i = 0; i < N; ++i) { + cin >> bs[i].first >> bs[i].second; + } + cout << solve() << endl; + + return 0; +} \ No newline at end of file