QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#353357#7857. (-1,1)-Sumpleteucup-team3215WA 0ms3640kbC++20844b2024-03-14 04:57:542024-03-14 04:57:55

Judging History

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

  • [2024-03-14 04:57:55]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-03-14 04:57:54]
  • 提交

answer

#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n; cin >> n;
  vector<string> v(n);
  for (auto& s: v) cin >> s;
  vector<tuple<int, int>> r(n), c(n), t(n);
  for (int i = 0; auto& [r, j]: r) cin >> r, j = i++;
  for (int i = 0; auto& [c, j]: c) cin >> c, j = i++;
  for (auto& [r, i]: r)
  for (auto& [c, j]: c) if (v[i][j] == '-') ++r, ++c;
  sort(r.rbegin(), r.rend());
  sort(c.rbegin(), c.rend());
  for (auto [x, i]: r) {
    for (auto& [y, j]: c) if (x > 0) v[i][j] ^= 6, --y, --x;
    sort((uint64_t*)&c[0], (uint64_t*)&c[n], greater{});
    if (x || get<0>(c[0]) < 0) return cout << "No\n", 0;
  }
  cout << "Yes\n";
  for (auto& s: v) { for (auto& c: s) c = c == '-'? '1': '0'; cout << s << '\n'; }
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3500kb

input:

3
+-+
-++
+-+
1 1 1
1 -1 3

output:

Yes
111
111
111

result:

ok n=3

Test #2:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

3
---
-++
+++
-2 -1 0
-2 -1 0

output:

Yes
110
100
000

result:

ok n=3

Test #3:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

3
+-+
-++
++-
1 0 2
2 2 -1

output:

No

result:

ok n=3

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3548kb

input:

1
-
-1
1

output:

Yes
1

result:

wrong answer wrong sum at col 1