VC驿站

 找回密码
 加入驿站

QQ登录

只需一步,快速开始

搜索
查看: 1349|回复: 2

Study Room

[复制链接]
09_avatar_middle
online_moderator 发表于 2010-4-11 21:09:01 | 显示全部楼层 |阅读模式
All of us like our second main teaching building and always prefer a comfortable seat. To make the following problem easy to handle, we assume there are N rows and M lines of seats in a study room. And we set each seat a singular comfortable value. That means there will not be two seats have same comfortable value. When a student comes into this room, he will choose the empty seat with the maximum comfortable value. However, if there is already a student adjoining to this seat (left or right), he will choose the empty seat with the next maximum comfortable value, until there is nobody at his left and right side.
As you see, if we know all the comfortable values, we can confirm how many students will be in this room. And this is your job.

Input (Please use standard input, and don’t read or write files.)

There are two integers N and M in the first line.
Then follows N lines, each contains M integers. The number on the ith line jth row means the comfortable value of the seat at ith line jth row.

Output (Please use standard output, and don’t read or write files.)

You should output n lines, each contains m characters. 'E' means there is no person on the seat, while 'P' means there is one.
Don't output any blank space and add a black line at end of your output.

Sample Input
3 4
1 2 3 4
5 6 7 8
9 10 11 12

Sample Output
EPEP
EPEP
EPEP

Hint
For 30% cases,   0 < N, M <= 40
For 70% cases,   0 < N, M <= 200
For 100% cases,  0 < N, M <= 400

评分

参与人数 1驿站币 +5 收起 理由
56_avatar_small zhaoshengbo + 5 辛苦了

查看全部评分





上一篇:Encode and Decode
下一篇:编写程序:C语言和C++还有VB,这些都可以。试题,大家试试能不能编出来。
56_avatar_middle
在线会员 发表于 2010-4-11 22:53:52 | 显示全部楼层
Study Room这英文也太唬人了吧...
09_avatar_middle
ico_lz  楼主| 发表于 2010-4-12 11:15:40 | 显示全部楼层
回复 2# zhaoshengbo


    呵呵,这也是一种锻炼嘛。学编程,英语肯定是必须要好的!
您需要登录后才可以回帖 登录 | 加入驿站 qq_login

本版积分规则

关闭

站长提醒上一条 /2 下一条

QQ|小黑屋|手机版|VC驿站 ( 辽ICP备09019393号tongdun|网站地图wx_jqr

GMT+8, 2019-3-25 23:19

Powered by Discuz! X3.4

© 2009-2019 cctry.com

快速回复 返回顶部 返回列表