---
# System prepended metadata

title: '2/19練習  '

---

a081. NOI2000 Day2.2.青蛙过河
===
https://zerojudge.tw/ShowProblem?problemid=a081
基本遞迴
```python=
n = int(input())
m = int(input())
ans = m + 1
def f(n):
    global ans
    if n == 0:
        return ans
    ans *= 2
    f(n-1)
f(n)
print(ans)
```




a080. NOI2000 Day2.1.单词查找树
===
https://blog.csdn.net/whistlena/article/details/78240258
去比對當前的單字跟前一個單字不一樣的字符有幾個
```python=
z = []
while True:
    a = input()
    if a == "":
        break
    a = a+"0"
    z.append(a)
z.sort()
ans = len(z[0])
for i in range(1,len(z)):
    for j in range(len(z[i-1])):
        if z[i][j]!= z[i-1][j]:
            break
    ans+= (len(z[i])-j-1)
print(ans)
```