CF126E.Pills

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

First 77 lines contain the doctor's picture. Each line contains 88 characters, each character can be "B", "R", "W" and "Y" that stands for blue, red, white and yellow colors correspondingly.

Next four lines contain 1010 numbers that stand for, correspondingly, the number of pills painted:

"BY" "BW" "BR" "BB"

"RY" "RW" "RR"

"WY" "WW"

"YY"

Those numbers lie within range from 00 to 2828 inclusively. It is guaranteed that the total number of pills in no less than 2828 .

输入格式

Print on the first line the maximal number cells for which the colors match.

Then print 1313 lines each containing 1515 characters — the pills' position in the optimal arrangement. The intersections of odd lines and odd columns should contain characters "B", "R", "W" and "Y". All other positions should contain characters ".", "-" and "|". Use "-" and "|" to show which halves belong to one pill. See the samples for more clarification.

If there are several possible solutions, print any of them.

输出格式

输入输出样例

  • 输入#1

    WWWBBWWW
    WWWBBWWW
    YYWBBWWW
    YYWBBWRR
    YYWBBWRR
    YYWBBWRR
    YYWBBWRR
    0 0 0 8
    0 1 5
    1 10
    5
    

    输出#1

    53
    W.W.W.B.B.W.W.W
    |.|.|.|.|.|.|.|
    W.W.W.B.B.W.W.W
    ...............
    Y.Y.W.B.B.W.W-W
    |.|.|.|.|.|....
    Y.Y.W.B.B.W.R.R
    ............|.|
    Y.Y.W.B.B.R.R.R
    |.|.|.|.|.|....
    Y.Y.W.B.B.W.R.R
    ............|.|
    Y-Y.B-B.B-B.R.R
    
  • 输入#2

    WWWWWWWW
    WBYWRBBY
    BRYRBWYY
    WWBRYWBB
    BWWRWBYW
    RBWRBWYY
    WWWWWWWW
    0 0 0 1
    0 0 1
    0 1
    25
    

    输出#2

    15
    W.Y.Y-Y.Y-Y.Y-Y
    |.|............
    W.Y.Y.Y.Y.B-B.Y
    ....|.|.|.....|
    Y-Y.Y.Y.Y.Y-Y.Y
    ...............
    Y.Y.Y.R.Y.Y.Y-Y
    |.|.|.|.|.|....
    Y.Y.Y.R.Y.Y.Y.Y
    ............|.|
    Y-Y.Y.Y-Y.Y.Y.Y
    ....|.....|....
    Y-Y.Y.Y-Y.Y.Y-Y
    
首页