|
#include <iostream>
#include <vector>
#include <string>
std::vector<int> multiply(const std::vector<int>& a, int b) {
std::vector<int> result(a.size(), 0);
int carry = 0;
for (size_t i = 0; i < a.size(); ++i) {
int product = a[i] * b + carry;
result[i] = product % 10;
carry = product / 10;
}
while (carry) {
result.push_back(carry % 10);
carry /= 10;
}
return result;
}
std::vector<int> powerOfTwo(int n) {
std::vector<int> result = {1};
int carry = 0;
while (n--) {
result = multiply(result, 2);
}
return result;
}
int main() {
int n;
std::cin >> n;
std::vector<int> result = powerOfTwo(n);
for (auto it = result.rbegin(); it != result.rend(); ++it) {
std::cout << *it;
}
return 0;
}
|
|