QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#227666 | #6541. Make Everything White | Lain | WA | 1ms | 3448kb | C++23 | 861b | 2023-10-27 20:57:36 | 2023-10-27 20:57:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
int n, m;
cin >> n >> m;
vector<string> v(n);
for (auto& x : v) cin >> x;
vector<string> ans(n, string(m, '2'));
for (int i =0; i < n; i++) {
for (int j =0; j < m; j++) {
int cnt = 4;
if (i == 0) cnt--;
if (i == n-1) cnt--;
if (j == 0) cnt--;
if (j == m-1) cnt--;
if (v[i][j] == 'B' && cnt%2 ==0 ) {
ans[i][j] = '3';
}
if (v[i][j] == 'W' && cnt%2 ==1) {
ans[i][j] = '3';
}
}
}
for (auto& x : ans) cout << x << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3448kb
input:
2 3 WBW BWB
output:
222 333
result:
wrong answer Integer 222 violates the range [-1, 1]