当前位置:网站首页>[summer daily question] Luogu P7550 [coci2020-2021 6] bold
[summer daily question] Luogu P7550 [coci2020-2021 6] bold
2022-07-25 01:21:00 【AC_ Dragon】
Topic link :P7550 [COCI2020-2021#6] Bold - Luogu | New ecology of computer science education (luogu.com.cn)
Title Description
Paula to Daniel Wrote a letter , She needs bold text , So that the eyesight deteriorates Daniel read .
The letter can be used . and # The matrix representation . For all the original letters #,Paula You need to expand it to the right and down to 2 × 2 Of #.
Input format
The first line has two integers n, m, Indicates the size of the letter .
Next n That's ok , Every time m Characters , Indicates the content of the letter .
Make sure there is no #.
Output format
n That's ok , Each row m Characters , Indicates a bold letter .
Examples #1
The sample input #1
4 4
....
.#..
....
....Sample output #1
....
.##.
.##.
....Examples #2
The sample input #2
7 7
.......
.####..
.#...#.
.#...#.
.#...#.
.####..
.......Sample output #2
.......
.#####.
.######
.##..##
.##..##
.######
.#####.Examples #3
The sample input #3
9 7
.......
.####..
.#...#.
.#...#.
.####..
.#.....
.#.....
.#.....
.......Sample output #3
.......
.#####.
.######
.##..##
.######
.#####.
.##....
.##....
.##....Tips
Data scale and agreement
about 100% The data of ,2 <= n, m <= 10^3. The guarantee letter only contains . and #.
explain
The score of this question is according to COCI Original question setting , Full marks 50.
The title is translated from COCI2020-2021 CONTEST #6 T1 Bold.
AC code:
#include<iostream>
#include<algorithm>
using namespace std;
const int n = 1e3 + 10;
const int m = 1e3 + 10;
char c[n][m];
int main()
{
vector<pair<int,int>> p;
int a,b;
cin>>a>>b;
for(int i=0;i<a;i++)
for(int j=0;j<b;j++)
{
cin>>c[i][j];
if(c[i][j]=='#')
p.push_back({i,j});
}
for(auto i:p)
{
c[i.first][i.second]='#';
c[i.first+1][i.second]='#';
c[i.first][i.second+1]='#';
c[i.first+1][i.second+1]='#';
}
for(int i=0;i<a;i++,cout<<endl)
for(int j=0;j<b;j++)
{
cout<<c[i][j];
}
return 0;
}边栏推荐
- How to better use the touchpad of notebook
- Luo min cannot become Dong Yuhui
- Document the use of anti shake in packaged components and projects
- Visual studio code installation package download slow & Installation & environment configuration & new one-stop explanation
- On let variable promotion
- [C + + primer notes] Chapter 6 functions
- Tiktok iqiyi announced cooperation, long and short video handshake and reconciliation?
- The position of the nth occurrence of MySQL in the string
- Summary of MATLAB basic grammar
- Human cell prosci 4-1BB ligand recombinant protein scheme
猜你喜欢

The current situation of the industry is disappointing. After working, I returned to UC Berkeley to study for a doctoral degree

Luo min cannot become Dong Yuhui

Unity image control and rawimage

Fabric. JS centered element

Tool use of rookie tutorial -- View subclass (implementation class) class diagram in idea

Unity panel control

After burning up 130 billion yuan in ten years, vertical e-commerce will eventually enter the dust of history
![[27. Expression evaluation (infix expression)]](/img/af/cf3c4a441232caeea9f9927ebdf87b.png)
[27. Expression evaluation (infix expression)]

MySQL series | log module

Example analysis of enum data type in MySQL
随机推荐
Password input box and coupon and custom soft keyboard
基于ABP实现DDD--领域逻辑和应用逻辑
Screenshot of Baidu map
Detailed explanation of zero length array in C language (1) [information at the end of the article]
[development tutorial 10] crazy shell · open source Bluetooth smart health watch OTA image production and download technical documents
Wireshark introduction and packet capturing principle and process
Vegetable greenhouses turned into smart factories! Baidu AI Cloud helps Shouguang, Shandong build a new benchmark for smart agriculture
Install scoop and lux (formerly Annie)
The IPO of Tuba rabbit was terminated: the annual profit fell by 33%, and Jingwei Sequoia was the shareholder
What does it operation and maintenance management mean? How to establish an effective IT operation and maintenance management system?
MySQL的最左前缀原则
7.20 - daily question - 408
Ad active directory and domain network
Resolution of multi thread conflict lock
Young people who lost the IPO
Fabric. JS centered element
第四章 驱动子系统开发
360 interview summary 2013 campus recruitment 2012-4-4
Nacos hand to hand teaching [i] dynamic configuration of Nacos
Specificity and five applications of Worthington alcohol dehydrogenase