From 27889f892444ea9478a3e18c556dda96ba892c8e Mon Sep 17 00:00:00 2001 From: Hiyabye Date: Sun, 14 Jan 2024 12:27:30 +0900 Subject: [PATCH] Add 30969.cpp --- 30xxx/30969.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 30xxx/30969.cpp diff --git a/30xxx/30969.cpp b/30xxx/30969.cpp new file mode 100644 index 00000000..a3001494 --- /dev/null +++ b/30xxx/30969.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +using namespace std; + +void solve(void) { + int n; cin >> n; + + unordered_map m; + int jinju = 0, ans = 0; + while (n--) { + string d; long long c; cin >> d >> c; + if (d == "jinju") jinju = c; + else if (c > 1000) ans++; + else m[c]++; + } + + for (auto [k, v] : m) { + if (k > jinju) ans += v; + } + cout << jinju << "\n" << ans; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); cout.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file