(код который дает правильные результаты но не на все ответы...)
#include
#include
using namespace std;
int main() {
const int base = 1000 * 1000 * 1000;
string sa;
cin >> sa;
vector a;
for (int i = (int)sa.length(); i > 0; i -= 9)
if (i < 9)
a.push_back(atoi(sa.substr(0, i).c_str()));
else
a.push_back(atoi(sa.substr(i - 9, 9).c_str()));
string sb;
cin >> sb;
vector b;
for (int i = (int)sb.length(); i > 0; i -= 9)
if (i < 9)
b.push_back(atoi(sb.substr(0, i).c_str()));
else
b.push_back(atoi(sb.substr(i - 9, 9).c_str()));
int carry = 0;
for (size_t i = 0; i < max(a.size(), b.size()) || carry; ++i) {
if (i == a.size())
a.push_back(0);
a[i] = a[i] | (carry + (i < b.size() ? b[i] : 0));
carry = a[i] >= base;
if (carry) a[i] -= base;
}
printf("%d", a.empty() ? 0 : a.back());
for (int i = (int)a.size() - 2; i >= 0; --i)
printf("%09d", a[i]);
}
P.S. почему то библиотеки стерлись (iostream и vector)