Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- s = input()
- sr = (n + 1) // 2
- uk1 = sr
- uk2 = n - sr
- while(1):
- uk2 = n - uk1
- f1 = 0
- f2 = 0
- a11 = 0
- a21 = 0
- a12 = 0
- a22 = 0
- if (s[uk1] != '0'):
- f1 = 1
- for i in range(0, uk1):
- a11 = a11 * 10 + (ord(s[i]) - ord('0'))
- for i in range(uk1, len(s)):
- a21 = a21 * 10 + (ord(s[i]) - ord('0'))
- uk1, uk2 = uk2, uk1
- if (s[uk1] != '0'):
- f2 = 1
- for i in range(0, uk1):
- a12 = a12 * 10 + (ord(s[i]) - ord('0'))
- for i in range(uk1, len(s)):
- a22 = a22 * 10 + (ord(s[i]) - ord('0'))
- if (f1 == 1 and f2 == 0):
- print(a11 + a21)
- exit(0)
- if (f1 == 0 and f2 == 1):
- print(a12 + a22)
- exit(0)
- if (f1 == 1 and f2 == 1):
- print(min(a11 + a21, a12 + a22))
- exit(0)
- uk1, uk2 = uk2, uk1
- uk1 -= 1
- print(1 / 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement