Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
my_pair temp;
for (auto &a: A) {
for (auto &b: B) {
temp.first = a.first + b.first;
auto it = C.find(temp);
if (it == C.end()) {
temp.second = a.second * b.second;
C.insert(temp);
} else {
it->second += a.second * b.second;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.