题目描述
blablabla
样例
blablabla
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
#include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
vector[HTML_REMOVED] ADD(vector[HTML_REMOVED] x, vector[HTML_REMOVED] y)
{
int t = 0;
vector[HTML_REMOVED] OUT;
for (int i = 0; i < x.size() || i < y.size(); i++)
{
if (i < x.size())
t += x[i];
if (i < y.size())
t += y[i];
OUT.push_back(t % 10);
t /= 10;
}
if (t)
OUT.push_back(t);
return OUT;
}
int main()
{
string a, b;
vector [HTML_REMOVED] A, B;
cin >> a >> b;
for (int i = a.size()-1; i >= 0; i--)
A.push_back(a[i] - '0');
for (int i = b.size()-1; i >= 0; i--)
B.push_back(b[i] - '0');
vector <int> m(ADD(A, B));
for (int i = m.size()-1; i >= 0; i--)
cout << m[i];
return 0;
}