XTU 1263 Super Resolution 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛(湖南)
2017-05-15 10:55
579 查看
Super Resolution
Accepted : 106 | Submit : 169 | |
Time Limit : 1000 MS | Memory Limit : 65536 KB |
Super Resolution
Bobo has an n×mpicture consists of black and white pixels.He loves the picture so he would like to scale it
a×b
times.That is, to replace each pixel with
a×b
block of pixels with the same color (see the example for clarity).
Input
The input contains zero or more test cases and is terminated by end-of-file. For each test case,The first line contains four integers
n,m,a,b.The
i-th
of the following n
lines contains a binary string of length
m
which denotes the i-th
row of the original picture. Character "
0" stands for a white pixel while the character "
1" stands for black one.
1≤n,m,a,b≤10
The number of tests cases does not exceed
10.
Output
For each case, output n×arows and m×b
columns which denote the result.
Sample Input
2 2 1 1 10 11 2 2 2 2 10 11 2 2 2 3 10 11
Sample Output
10 11 1100 1100 1111 1111 111000 111000 111111 111111
解题思路:这题真的是道水题。。。
代码如下:
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
int main()
{
int n,m,a,b;
char s[22][22];
while(scanf("%d %d %d %d",&n,&m,&a,&b)!=EOF)
{
for(int i=0; i<n; i++)
scanf("%s",s[i]);
for(int i=0; i<n*a; i++)
{
for(int j=0; j<b*m; j++)
printf("%c",s[i/a][j/b]);
printf("\n");
}
}
return 0;
}
相关文章推荐
- XTU 1268 Strange Optimization 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛(湖南)
- xtu 1260 Determinant [2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛(湖南) A题]
- XTU 1264 Partial Sum 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛(湖南)
- xtu 1268 Strange Optimization 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛(湖南)
- xtu 1260 Determinant [2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛(湖南) A]
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛 Super Resolution
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛 Partial Sum
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛 Strange Optimization
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛 Highway
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛:H—Highway
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛:E—Partial Sum
- 2017年“嘉杰信息杯” 中国大学生程序设计竞赛全国邀请赛:I— Strange Optimization
- XTU OJ 1209 Alice and Bob 2014(嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛)
- 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛 E
- XTU OJ 1209 Alice and Bob 2014(嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛)
- 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛 解题报告
- 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛
- 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛
- 2017年中国大学生程序设计竞赛网络赛杭电OJ---1003 Friend-Graph
- 2017年浙江中医药大学大学生程序设计竞赛(重现赛)H - 剪纸