Submission #9477547 - AtCoder Grand Contest 004 | AtCoder
// ===================================
// author: M_sea
// website: http://m-sea-blog.com/
// ===================================
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#define re register
using namespace std;
inline int read()
{
int X = 0, w = 1;
char c = getchar();
while (c < '0' || c > '9')
{
if (c == '-')
w = -1;
c = getchar();
}
while (c >= '0' && c <= '9')
X = X * 10 + c - '0', c = getchar();
return X * w;
}
const int N = 500 + 10;
int n, m;
char s[N][N], a[N][N], b[N][N];
int main()
{
n = read(), m = read();
for (re int i = 1; i <= n; ++i)
scanf("%s", s[i] + 1);
memcpy(a, s, sizeof(a)), memcpy(b, s, sizeof(b));
for (re int i = 1; i <= n; ++i)
for (re int j = 2; j < m; ++j)
i & 1 ? a[i][j] = '#' : b[i][j] = '#';
for (re int i = 1; i <= m; ++i)
a[i][1] = '#', b[i][m] = '#';
for (re int i = 1; i <= n; ++i)
puts(a[i] + 1);
puts("");
for (re int i = 1; i <= n; ++i)
puts(b[i] + 1);
return 0;
}
Submission
Task
C - AND Grid
User name
M_sea
Created time
2020/01/12 21:39:34
Language
C++14 (GCC 5.4.1)
Status
AC
Score
700
Source length
968 Byte
File name
Exec time
3 ms
Memory usage
1536 KB
评论
发表评论