A1255 | [COCI-2012_2013-contest2]#3 KRIZALJKA
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Do you like to solve crosswords? If you do, you probably know the traditional lead-in for beginners –
small 3 by 3 crosswords, like the following1:
1 2 3 2 3 Horizontal:
1. device used to cool a PC
2. solid water
3. to obtain Vertical:
1. small, soft, sweet fruit
2. strong playing card
3. fisherman's tool 1Solve a crossword like this one! Not gonna happen? Fine, then at least put it together given six words that appear in it (three as horizontal and three as vertical).
small 3 by 3 crosswords, like the following1:
1 2 3 2 3 Horizontal:
1. device used to cool a PC
2. solid water
3. to obtain Vertical:
1. small, soft, sweet fruit
2. strong playing card
3. fisherman's tool 1Solve a crossword like this one! Not gonna happen? Fine, then at least put it together given six words that appear in it (three as horizontal and three as vertical).
输入格式
Each of the six lines of input contains a word consisting of three uppercase English letters. The words are given in a lexicographically sorted order.
输出格式
If it is impossible to put together a 3 by 3 crossword using the given six words, output
0.
Otherwise, output the crossword in three lines.
If there is more than one possible solution, output the one that is first in lexicographic order, where,
for sorting purposes, the crossword is viewed as a nine-letter word obtained by concatenating its rows.
0.
Otherwise, output the crossword in three lines.
If there is more than one possible solution, output the one that is first in lexicographic order, where,
for sorting purposes, the crossword is viewed as a nine-letter word obtained by concatenating its rows.
输入输出样例
输入 #1
ANA ANA DAR DAR RAD RAD
输出 #1
DAR ANA RAD
输入 #2
EVO HEP HIR IVA PAD ROD
输出 #2
HEP IVA ROD
输入 #3
AKO CES DOC DON ESI KES
输出 #3
0
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted