💡 The idea
Two integers $a$ and $b$ are given. Compute their sum $a + b$.
📐 Algorithm and analysis
Read the two numbers from standard input. The numbers can be up to $10^9$, so the long long type is recommended.
- Time complexity: $O(1)$
- Memory complexity: $O(1)$
💻 Official solution (C++)
#include <iostream>
using namespace std;
int main() {
long long a, b;
if (cin >> a >> b) {
cout << a + b << "
";
}
return 0;
}