#include <iostream> #include <map> int main() { int n; std::cin >> n;//读取输入的记录数量n std::map<int, int> table; // Map to hold index and sum of values while (n--) { int index, value; std::cin >> index >> value; table[index] +...