• [A] Minecraft Server Bug

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Oh Jesus! The Minecraft Server of XadillaX's came across a bug!
    There's one way to solve this bug in game. That is to get a bucket of water and a bucket of lava and mix them to obsidian. But remember, you must get water first, or the server will explode! Boom~
    Fortunately there is a row of buckets at front of Hungar, he can save the world!


    Some of buckets are filled with water and some are lava. Remember that Hungar can only move forward, that means when Hungar move to one bucket, he can't move back to the buckets behind this bucket. And he must get water first.
    Now give you the sort of buckets, please help Hungar to calculate out that how many ways he can save the world.

  • 输入
  • This problem contains several cases because of the XIONG HAI ZI, Minary.
    The first line of each case contains one integer N (0 < N ≤ 1000000) which indicates the number of buckets.
    Next line follows N buckets in from near to far which `W` indicates water and `L` indicates lava.
  • 输出
  • For each case, output the ways Hungar can save the Minecraft world.
  • 样例输入
  • 5
    W L W L L
    3
    W W L
    
  • 样例输出
  • 5
    2
    
  • 提示
  • 来源
  • cjl
  • 操作

显示春菜