• [1208] Luo Tianyi and Yayin Gongyu

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Yayin is the precusor of Tianyi. Tianyi gradually replace Yayin to sing.
    So here's a song called "Sing to Yayin".

    Now Tianyi wants to cross the space-time to meet the previous self.
    The time tunnel is unidirectional. So it's not sure Tianyi can meet Yayin.
    But the God is moved by her songs. He decided to change some time tunnels to theirs negative direction.

    The question is what's the minimum time tunnels God has to change that Tianyi can cross the space-time to meet Yayin.


  • 输入
  • This problem has several cases.
    The first line of each case contains two integers N and M (1 < N <= 100, 1 <= M < 10000), indicates the number of space-time and the number of time-tunnels.
    Next follow M lines, each line contains two integers X and Y. That means there's a time tunnel from space-time X to space-time Y. (space-time numbers are numbered from 0)
    The last line contains two integers T and Y, indicates the space-time where Tianyi and Yayin are at.
  • 输出
  • You should output the minimum time tunnels God has to change that Tianyi can cross the space-time to meet Yayin.
    If she can't meet Yayin, then output 'Mystery Moving'.
  • 样例输入
  • 5 3
    3 4
    3 2
    1 2
    3 1
    
  • 样例输出
  • 1
    
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜