当前位置:网站首页>[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;
}边栏推荐
- BisinessCardGen
- Redis管道技术/分区
- After burning up 130 billion yuan in ten years, vertical e-commerce will eventually enter the dust of history
- WhatsApp web for usability testing of software testing technology
- Kubernetes creates a user with dashboard read-only permission (with exec permission)
- A string "0" was actually the culprit of the collapse of station b
- Take C language from 0 to 1 - program structure and use examples
- [26. String hash]
- The difference between sigsuspend and sigwait
- [icore4 dual core core _arm] routine 22: LwIP_ UDP experiment Ethernet data transmission
猜你喜欢

Young people who lost the IPO

Open source demo | release of open source example of arcall applet
10 commonly used data visualization tool software

DotNetCore. Cap notes

Musk responded whether he would upload his brain to the cloud: already did it!
![[25. Hash table]](/img/c4/1500d070d44d3bd84eb141ed38013d.png)
[25. Hash table]

Divide 300000 bonus! Deeperec CTR model performance optimization Tianchi challenge is coming

Latex notes
![Detailed explanation of zero length array in C language (1) [information at the end of the article]](/img/89/1f01e24ce52b2d459f26397cd8527f.png)
Detailed explanation of zero length array in C language (1) [information at the end of the article]

Wireshark packet capturing and rapid packet location skills
随机推荐
Musk responded whether he would upload his brain to the cloud: already did it!
Yolov7:oserror: [winerror 1455] the page file is too small to complete the final solution of the operation
MySQL series | log module
The current situation of the industry is disappointing. After working, I returned to UC Berkeley to study for a doctoral degree
Take C language from 0 to 1 - program structure and use examples
How SAP Spartacus redefines login component
Brush questions of binary tree (5)
What is the root password of MySQL initial installation
The two supply chain centers of HEMA launched the "background" of innovative research and development of multi format commodities
Why is the exclude or include attribute setting of the < keep alive > component invalid
The first meta universe auction of Chen Danqing's printmaking works will open tomorrow!
Luo min cannot become Dong Yuhui
How to create an index
7.16 - daily question - 408
[C + + primer notes] Chapter 8 IO Library
Unity panel control
Custom type
About the difference between for... In and for... Of and object. Keys()
Method properties of ASP adodb.stream object
Plug ins QRcode and ityped