This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<string> s(2 * n);
for (int i = 0; i < 2 * n; i++) {
cin >> s[i];
}
if (n == 1) {
if (s[0] == "000") {
if (s[1] == "000") {
cout << string(3, '1') << '\n' << string(3, '2') << '\n';
} else if (s[1] == "...") {
cout << string(3, '1') << '\n' << string(3, '.') << '\n';
} else {
cout << "nemoguce" << '\n';
}
} else if (s[0] == "...") {
if (s[1] == "000") {
cout << string(3, '.') << '\n' << string(3, '1') << '\n';
} else {
cout << "nemoguce" << '\n';
}
} else if (s[0] == ".00") {
if (s[1] == "..0") {
cout << ".11\n..1\n";
} else {
cout << "nemoguce" << '\n';
}
} else if (s[0] == "0.0") {
cout << "nemoguce" << '\n';
} else if (s[0] == "00.") {
if (s[1] == "0..") {
cout << "11.\n1..\n";
} else {
cout << "nemoguce" << '\n';
}
} else if (s[0] == "0..") {
if (s[1] == "00.") {
cout << "1..\n11.\n";
} else {
cout << "nemoguce" << '\n';
}
} else if (s[0] == ".0.") {
cout << "nemoguce" << '\n';
} else if (s[0] == "..0") {
if (s[1] == ".00") {
cout << "..1\n.11\n";
} else {
cout << "nemoguce" << '\n';
}
} else {
assert(false);
}
} else {
cout << "nemoguce" << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |