zoukankan      html  css  js  c++  java
  • PowerOJ 2789 上决╇ф的战争 (KMP)

    2789: 上决╇ф的战争

    Time Limit: 1000 MS Memory Limit: 65536 KB
    Total Submit: 14 Accepted: 1 Page View: 38
    Submit Status Discuss

    上决╇ф及其手下锐龙、皓龙、速龙、羿龙、毒龙、闪龙等CPU,以最高频率,杀到了Alpha Ceph所在地。但是Alpha Ceph的洞穴门,是一个十分强大的密码门。这个密码门和斐波那契字符串相关,斐波那契字符串见下图:

    F(n)=0n=01n=1F(n1)+F(n2)n2

    n
     F(n)
     
    0
      0
     
    1
      1
     
    2
      10
     
    3
      101
     
    4
      10110
     
    5
      10110101
     
    6
      1011010110110
     
    7
      101101011011010110101
     
    8
      1011010110110101101011011010110110
     
    9
      1011010110110101101011011010110110101101011011010110101
     

    Alpha Ceph的门上就贴了一个01字符串,只要输出这个字符串在第n

    位斐波那契字符串中出现的次数,就能开带Alpha Ceph的大门,击杀Alpha Ceph!

    输入第一行,包含一个整数n

    ,(1n100),表现需要询问第n个斐波那契字符串。
    第二行,包含一个长度不超105

    的01字符串,表示被查询的字串。
    输出一个整数,为输入的01串在第n

    个斐波那契串中出现的次数。结果对264

    取模。
    6 10 6 101
  • 相关阅读:
    [LeetCode 题解]: Triangle
    [LeetCode 题解]: pow(x,n)
    [LeetCode 题解]: plusOne
    [LeetCode 题解]: ZigZag Conversion
    error: field 'b' has imcomplete type
    两个分数的最小公倍数
    DDR工作原理
    流水线技术原理和Verilog HDL实现
    FPGA主要应用
    提高器件工作的速度
  • 原文地址:https://www.cnblogs.com/a249189046/p/8876355.html
Copyright © 2011-2022 走看看