-
Notifications
You must be signed in to change notification settings - Fork 186
Expand file tree
/
Copy pathc.cc
More file actions
69 lines (67 loc) · 1.51 KB
/
c.cc
File metadata and controls
69 lines (67 loc) · 1.51 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// https://codeforces.com/contest/989/problem/C
#include <bits/stdc++.h>
using namespace std;
using ii = tuple<int, int>;
using vii = vector<ii>;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
string s = "ABCD";
vii x = {{a, 0}, {b, 1}, {c, 2}, {d, 3}};
sort(x.begin(), x.end());
cout << 50 << ' ' << 50 << '\n';
char ch1 = s[get<1>(x[3])];
int c1 = get<0>(x[3]);
char ch2 = s[get<1>(x[0])];
int c2 = get<0>(x[0]);
int i = 0;
while (c1) {
for (int j = 0; j < 50; j++) {
if (!c1 || i%2 || j%2) cout << ch2;
else cout << ch1, c1--;
}
cout << '\n';
i++;
}
for (int j = 0; j < 50; j++) cout << ch2;
cout << '\n';
i++;
ch1 = s[get<1>(x[2])];
c1 = get<0>(x[2]);
while (c1) {
for (int j = 0; j < 50; j++) {
if (!c1 || i%2 || j%2) cout << ch2;
else cout << ch1, c1--;
}
cout << '\n';
i++;
}
for (int j = 0; j < 50; j++) cout << ch2;
cout << '\n';
i++;
ch1 = s[get<1>(x[1])];
c1 = get<0>(x[1]);
while (c1>1) {
for (int j = 0; j < 50; j++) {
if (c1<=1 || i%2 || j%2) cout << ch2;
else cout << ch1, c1--;
}
cout << '\n';
i++;
}
for (int j = 0; j < 50; j++) cout << ch2; cout << '\n';
for (int j = 0; j < 50; j++) cout << ch1; cout << '\n';
i += 2;
while (c2>1) {
for (int j = 0; j < 50; j++) {
if (c2<=1 || i%2 || j%2) cout << ch1;
else cout << ch2, c2--;
}
cout << '\n';
i++;
}
for (;i<50;i++) {
for (int j = 0; j < 50; j++) cout << ch1;
cout << '\n';
}
}