From 9c94231fd4b451733541f84da0dac65609d1d56f Mon Sep 17 00:00:00 2001 From: Hiyabye Date: Sun, 14 Jan 2024 20:21:42 +0900 Subject: [PATCH] Add 31009.cpp --- 31xxx/31009.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 31xxx/31009.cpp diff --git a/31xxx/31009.cpp b/31xxx/31009.cpp new file mode 100644 index 00000000..a3001494 --- /dev/null +++ b/31xxx/31009.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