QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#353357 | #7857. (-1,1)-Sumplete | ucup-team3215 | WA | 0ms | 3640kb | C++20 | 844b | 2024-03-14 04:57:54 | 2024-03-14 04:57:55 |
Judging History
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'; }
}
Details
Tip: Click on the bar to expand more detailed information
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