forked from mpfeifer1/Kattis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathokvir.cpp
48 lines (40 loc) · 944 Bytes
/
okvir.cpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int rows, cols;
cin >> rows >> cols;
int u, l, r, d;
cin >> u >> l >> r >> d;
vector<vector<char>> v;
v.resize(rows + u + d);
for(auto& row : v) {
row.resize(cols + l + r, '#');
}
for(int i = 0; i < v.size(); i++) {
for(int j = 0; j < v[i].size(); j++) {
//v[i][j] = '#';
if((i+j) % 2 == 1) {
v[i][j] = '.';
}
}
}
vector<string> s;
for(int i = 0; i < rows; i++) {
string temp;
cin >> temp;
s.push_back(temp);
}
for(int i = 0; i < rows; i++) {
for(int j = 0; j < cols; j++) {
v[i+u][j+l] = s[i][j];
}
}
for(int i = 0; i < v.size(); i++) {
for(int j = 0; j < v[i].size(); j++) {
cout << v[i][j];
}
cout << endl;
}
}