程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> string-Tetris Alphabet

string-Tetris Alphabet

編輯:編程解疑
Tetris Alphabet

Description

The game of Tetris is played with four-connected blocks falling down the well having N rows and 20 columns. Each figure is marked with a unique English letter from 'A' to 'Z'.
Your program must, given the state of the well, determine the order in which the blocks fell down.
Input

The first line of input file contains integer N (1 <= N <= 50) -- number of rows. Following N lines contain 20 characters each, with characters that are either a letter from 'A' to 'Z' or the dot character (ASCII 46), representing an empty cell.
Output

Output file must contain a string of letters indicating the order in which figures fell down. If there is more than one order, lexicographically smallest one must be printed. Input data will guarantee that at least one nonempty order exists.
Sample Input

6
...........XX.......
..........MMMM......
..........K.........
........KKK.........
.....ZAAA.FFF.......
.....ZZZA..F.B......
Sample Output

BFZAKMX

最佳回答:


http://bailian.openjudge.cn/contest1811/D/

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved