QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#353356#7857. (-1,1)-Sumpleteucup-team3215Compile Error//C++20828b2024-03-14 04:56:432024-03-14 04:56:43

Judging History

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

  • [2024-03-14 04:56:43]
  • 评测
  • [2024-03-14 04:56:43]
  • 提交

answer

#include <algorithm>
#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[n - 1]) < 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

answer.code: In function ‘int main()’:
answer.code:21:11: error: ‘uint64_t’ was not declared in this scope
   21 |     sort((uint64_t*)&c[0], (uint64_t*)&c[n], greater{});
      |           ^~~~~~~~
answer.code:4:1: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    3 | #include <vector>
  +++ |+#include <cstdint>
    4 | 
answer.code:21:20: error: expected primary-expression before ‘)’ token
   21 |     sort((uint64_t*)&c[0], (uint64_t*)&c[n], greater{});
      |                    ^
answer.code:21:38: error: expected primary-expression before ‘)’ token
   21 |     sort((uint64_t*)&c[0], (uint64_t*)&c[n], greater{});
      |                                      ^