Problem:
Addition of Big Integers

Given two integers $A$ and $B$, compute the sum, $A + B$.

Input

Two integers $A$ and $B$ separated by a space character are given in a line.

Output

Print the sum in a line.

Constraints

$-1 \times 10^{100000} \leq A, B \leq 10^{100000}$

Sample Input 1

5 8

Sample Output 1

13

Sample Input 2

100 25

Sample Output 2

125

Sample Input 3

-1 1

Sample Output 3

0

Sample Input 4

12 -3

Sample Output 4

9

Solution in C# (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {

        //加算
        static string AddBig(string s, string t)
        {
            int[] a = StringToPlustInt(s);
            int[] b = StringToPlustInt(t);
            int a_len = (s[0] != '-' ? s.Length : s.Length - 1);
            int b_len = (t[0] != '-' ? t.Length : t.Length - 1);

            int[] sum = new int[Math.Max(a_len, b_len) + 1];

            if (s[0] != '-' && t[0] != '-')
            {
                Plus(a, b, sum);
                return IntArrayToString(sum);
            }

            if (s[0] == '-' && t[0] == '-')
            {
                Plus(a, b, sum);
                return "-" + IntArrayToString(sum);
            }

            if (s[0] == '-') //常にaが正、bが負で考える。
            {
                int[] temp = b; b = a; a = temp;
                string temp_ = t; t = s; s = temp_; //Cmpでは文字列の方で比較するのでこちらもswap 
            }

            int[] larger = a;
            int[] smaller = b;
            string sign = "";
            if (Cmp(s, t.Substring(1)) < 0)
            {
                larger = smaller;
                smaller = a;
                sign = "-";
            }

            Minus(larger, smaller, sum);

            return sign + IntArrayToString(sum);
        }
        //符号なし数字文字列において、数値としてsのほうがtよりなら1 同じなら0 小さいなら -1
        static int Cmp(string s, string t)
        {
            if (s == t) return 0;
            if (s.Length > t.Length) return 1;
            if (s.Length < t.Length) return -1;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] > t[i]) return 1;
                else if (s[i] < t[i]) return -1;
            }

            return -9999999; //エラー
        }
        //どちらも正のときの加算
        static void Plus(int[] a, int[] b, int[] sum)
        {

            int i = a.Length - 1;
            int j = b.Length - 1;
            int k = sum.Length - 1;
            while (i >= 0 || j >= 0)
            {
                int v = 0;
                int w = 0;
                if (i >= 0) v = a[i];
                if (j >= 0) w = b[j];
                int x = v + w + sum[k];
                if (x >= 10)
                {
                    sum[k - 1] += 1;
                    x %= 10;
                }

                sum[k] = x;
                i--;
                j--;
                k--;
            }
        }
        //正の大きい方の数から正の小さい方を減算
        static void Minus(int[] larger, int[] smaller, int[] sum)
        {
            int i = larger.Length - 1;
            int j = smaller.Length - 1;
            int k = sum.Length - 1;

            while (i >= 0 || j >= 0)
            {
                int v = 0;
                int w = 0;
                if (i >= 0) v = larger[i];
                if (j >= 0) w = smaller[j];
                int x = v - w;
                if (x < 0)
                {
                    x += 10;
                    int csr = i - 1;
                    while (larger[csr] == 0)
                    {
                        larger[csr] = 9;
                        csr--;
                    }
                    larger[csr]--;
                }
                sum[k] = x;
                i--;
                j--;
                k--;
            }
        }

        //符号付き(-のみ)数字文字列をint[]に変換。
        static int[] StringToPlustInt(string s)
        {
            return s.SkipWhile(x => x == '-').Select(y => y - '0').ToArray();
        }

        //int[]をstringに変換。最初の値が0の場合無視
        static string IntArrayToString(int[] array)
        {
            string ret = string.Join("", array.SkipWhile(x => x == 0).Select(y => y.ToString()));
            if (ret == "") ret = "0";
            return ret;
        }

        static void Main(string[] args)
        {
            var st = Console.ReadLine().Split(' ');
            string s = st[0];
            string t = st[1];
            Console.WriteLine(AddBig(s, t));
        }
    }
}