# | Problem | Pass Rate (passed user / total user) |
---|---|---|
12913 | Big number addition |
|
13996 | Squidward Musical |
|
Description
In the most of arithmetic addition case, we can simply use int or long long to store the two integers and compute the answer by the operater '+' in C. If we have two big integers that can not be stored into the varibles mentioned below, we should make use of arrays to complete the addition task.
Given two big number A, B, please compute A + B.
Input
First line contains an integer which denotes the length of A. The following one line contains the big integer A.
Third line contains an integer which denotes the length of B. The following one line contains the big integer B.
(1 ≤ number of digits of A, B ≤ 100, both A and B are intergers ≥ 0)
Output
An integer which denotes the answer of A + B.
Note that you don't need to print '\n' at the end of the output
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Spongebob and Patrick is watching Squidward play his clarinet so that they can learn and play for themselves. So that they can review later on, Patrick decided to take notes of the music squidward is playing. In order to take notes, patrick converts the music he hears to a string of characters (a-z).
When Spongebob reads the notes, he notices something very interesting. The notes that patrick writes contains a lot of palindromes and Spongebob suspects that this is the key to copying Squidward's beautiful music but just to be sure, he wants to count how many palindromes are in the string.
Palindromes is a set of words that are read the same when written forwards and backwards, however for this problem, palindromes that have 2 characters or less do not count.
For example the string elellal contains only 3 palindromes:
- ele
- lel
- lal
'll' does not count as a palindrome because it only has 2 characters.
Count how many palindromes are in a given string from patrick's notes.
Note: duplicate palindromes still count!
For example the string elele contains 4 palindromes:
- ele
- lel
- ele
- elele
Input
A single string with length l (1 <= l <= 1000).
Output
The number of Palindromes in the string followed by a newline character "\n".