본문 바로가기

USACO/Bronze

백준 14175 The Cow-Signal (USACO December 2016 Bronze 3번)

문제 링크: https://www.acmicpc.net/problem/14175

 

14175번: The Cow-Signal

Bessie and her cow friends are playing as their favorite cow superheroes. Of course, everyone knows that any self-respecting superhero needs a signal to call them to action. Bessie has drawn a special signal on a sheet of M×N paper (1≤M≤10,1≤N≤10), but thi

www.acmicpc.net

하나의 케릭터를 받을때마다 가로 세로 두 방향모두로 K배 해서 ans배열에 입력함.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <bits/stdc++.h>
using namespace std;
 
int N, M, K;
char ans[101][101];
 
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
 
    cin >> N >> M >> K;
    for(int i = 0; i < N; i++for(int j = 0; j < M; j++) {
        char c;
        cin >> c;
 
        for(int k = K * i; k < K * i + K; k++for(int l = K * j; l < K * j + K; l++)
            ans[k][l] = c;
    }
 
    for(int i = 0; i < K * N; i++) {
        for(int j = 0; j < K * M; j++) {
            cout << ans[i][j];
        }
        cout << '\n';
    }
    return 0;
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter