QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#227666#6541. Make Everything WhiteLainWA 1ms3448kbC++23861b2023-10-27 20:57:362023-10-27 20:57:37

Judging History

你现在查看的是最新测评结果

  • [2023-10-27 20:57:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3448kb
  • [2023-10-27 20:57:36]
  • 提交

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';
}

详细

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]