#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> input(n);
for (int i = 0; i < n; ++i) {
cin >> input[i];
}
ofstream fout("output.txt");
for (int i = 0; i < n; ++i) {
string row = "";
for (int j = 0; j < m; ++j) {
if (input[i][j] == '#') {
row += '#';
} else {
if (i == n - 1) {
row += '.';
}
else if (i % 3 == 2) {
row += '.';
}
else if (i % 3 == 0) {
if (j == 0)
row += '.';
else
row += 'X';
}
else { // i % 3 == 1
if (j % 2 == 0)
row += '.';
else
row += 'X';
}
}
}
fout << row << '\n';
}
fout.close();
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... |
# | 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... |