Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <cmath>
- #include <iostream>
- #include <map>
- #include <unordered_map>
- #include <vector>
- int main() {
- int linesNum;
- std::unordered_map<std::string, long long> markSum, marksNum;
- std::cin >> linesNum;
- for (int i = 0; i < linesNum; i++) {
- int mark;
- std::string surname;
- std::cin >> surname >> mark;
- markSum[surname] += mark;
- marksNum[surname] += 1;
- std::cout << markSum[surname] / marksNum[surname] << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement