A8323 | Pills
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
First $7$ lines contain the doctor's picture. Each line contains $8$ characters, each character can be "B", "R", "W" and "Y" that stands for blue, red, white and yellow colors correspondingly.
Next four lines contain $10$ 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 $0$ to $28$ inclusively. It is guaranteed that the total number of pills in no less than $28$ .
Next four lines contain $10$ 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 $0$ to $28$ inclusively. It is guaranteed that the total number of pills in no less than $28$ .
输入格式
Print on the first line the maximal number cells for which the colors match.
Then print $13$ lines each containing $15$ 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.
Then print $13$ lines each containing $15$ 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
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted