💡 The idea
Find the square of the given integer $n$ ($n^2 = n \cdot n$).
📐 Algorithm and analysis
Multiplying the number by itself is enough: $n^2 = n \times n$.
- Time complexity: $O(1)$
- Memory complexity: $O(1)$
💻 Official solution (C++)
#include <iostream>
using namespace std;
int main() {
long long n;
if (cin >> n) {
cout << n * n << "
";
}
return 0;
}