• [F] Gobang

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Gobang consists of 15*15 lattices.There are two colors of pieces about black and white.There are many kinds of rules about the game in the world,so now set a rule.White is former,black is latter.The coordinate of chessboard is from (1,1) to (15,15).If there are five or more than five pieces which are the same color continuously on the same line,he should take back these pieces and next to another (All of pieces are placed on blank position).

  • 输入
  • The input data include several cases, input until EOF.
    For each test,there is a positive integer N,it expresses the number of draughting times of two players.
    Then follows N lines,each line includes two positive integers x and y,x is the coordinate of line,y is the coordinate of column.
  • 输出
  • For each test,you should output the number of pieces which each player takes back.
  • 样例输入
  • 10
    1 1
    1 2
    2 1
    2 2
    3 1
    3 2
    4 1
    4 2
    5 1
    5 2
  • 样例输出
  • white:5
    black:5
  • 提示
  • 来源
  • hungar
  • 操作

显示春菜