FB(斐波那契)

题目:

公式:
开头为0,1,后面的每一项为前两项的和

思路:
根据斐波那契的值对应给的字符串的索引

s = "VERAYTRGUYTLOUYTFDRKONMLKJOPGF65DD"
list = [0, 1]
print(len(list))
flag = ""
for i in range(len(s)):
    new = list[len(list) - 1] + list[len(list) - 2]
    list.append(new)

print(list)
for i in list[1:]:
    if i <= len(s):
        flag += s[i - 1]
print(flag)
# flag{VVERYGOOD}

posted @ 2025-05-10 10:22  lethe311  阅读(7)  评论(0)    收藏  举报