Skip to content

Commit

Permalink
Add 31009.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jan 14, 2024
1 parent 708f2eb commit 9c94231
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 31xxx/31009.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;

void solve(void) {
int n; cin >> n;

unordered_map<long long, int> 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;
}

0 comments on commit 9c94231

Please sign in to comment.