Sicily 11157. Crossword

Source: Internet
Author: User
Tags creative commons attribution

11157. Crossword
Time Limit:1sec    Memory Limit:256mbdescriptionmirko has assembled a excellent crossword puzzle and now he WA NTS to frame it. Mirko ' s crossword puzzle consists of M x N Letters, and the frame around it should be U characters wide on top, L characte RS on the left, R characters on the right and D characters on the bottom side. The frame consists of characters # (hash) and. (dot) which alternate like fields on a chessboard. These characters should be arranged in a-a-would, if the frame is expanded to cover the entire crossword puzzle and we TR Eat these characters as a chessboard, the # characters should is placed as the red fields on a chessboard (i.e. the top le FT field). See the examples below for a better understanding of the task. Inputthe first line of input contains, integers M and N (1≤m, n≤10). The second line of input contains integers U, L, R, D (0≤u, L, R, D≤5). The following M lines of input contains N characters–lowercase letters of the English AlphAbet. These lines represent Mirko ' s crossword puzzle. Outputoutput the framed crossword puzzle as stated in the text. Sample Input copy sample Input to Clipboard
Example 1:4 2 2 2honiokernerairak sample 2:2 0 3 1rimamama
Sample Output
Sample 1:#.#.#.#: #.#.#.##.honi#. #oker. ##.nera#. #irak. ##.#.#.#. #.#.#. #样例2: #.#.#. #rima. #.mama#.#.#.#.#.
problem#: 11157//submission#: 3719849//The source code is licensed under Creative Commons attribution-noncommercial-s Harealike 3.0 Unported license//uri:http://creativecommons.org/licenses/by-nc-sa/3.0///all Copyright reserved by Informatic Lab of Sun Yat-sen university#include <algorithm> #include <iostream> #include <string># Include <cstdio> #include <queue> #include <cstring> #include <vector> #include <iomanip>    #include <map> #include <stack> #include <list>using namespace Std;int main () {int n, m;    CIN >> n >> m;    int U, L, R, D;    CIN >> u >> l >> R >> D;    vector<vector<char> > B (n + U + d);        for (int i = 0; i < b.size (), i++) {vector<char> line (M + L + R);    B[i] = line;  } for (int i = 0; i < b.size (), i++) {for (int j = 0; J < b[i].size (); + j) {if ((i + j)% 2)            B[I][J] = '. '; else B[i][j]= '#';        }} for (int i = 0; i < n; i++) {string S;        Cin >> S;        for (int j = 0; J < S.size (); j + +) {B[u + i][l + j] = S[j]; }} for (int i = 0; i < b.size (), i++) {for (int j = 0; J < b[i].size (); + j) {cout &LT;&L T        B[I][J];    } cout << Endl;                                  } return 0;}


Sicily 11157. Crossword

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.