Created
June 19, 2015 14:05
-
-
Save bluescarni/958471b1ab351921799b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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