QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#308204#6652. 着色ckiseki#WA 3ms3584kbC++201.8kb2024-01-19 18:33:472024-01-19 18:33:48

Judging History

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

  • [2024-01-19 18:33:48]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3584kb
  • [2024-01-19 18:33:47]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define all(x) begin(x), end(x)
#ifdef local
#include <experimental/iterator>
#define safe cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(a...) debug_(#a, a)
#define orange(a...) orange_(#a, a)
void debug_(const char *s, auto ...a) {
  cerr << "\e[1;32m(" << s << ") = (";
  int f = 0;
  (..., (cerr << (f++ ? ", " : "") << a));
  cerr << ")\e[0m\n";
}
void orange_(const char *s, auto L, auto R) {
  cerr << "\e[1;33m[ " << s << " ] = [ ";
  using namespace experimental;
  copy(L, R, make_ostream_joiner(cerr, ", "));
  cerr << " ]\e[0m\n";
}
#else
#define safe ((void)0)
#define debug(...) safe
#define orange(...) safe
#endif

const int maxn = 100;
using BS = bitset<maxn>;


BS A[maxn];

BS M[maxn];

int main() {
  cin.tie(nullptr) -> sync_with_stdio(false);

  const int n = 100;
  mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      A[i][j] = rng() & 1;
    }
  }

  /* for (int i = 0; i < n; i++) */
  /*   debug(A[i]); */

  for (int j = 0; j < n; j++) {

    for (int i = 0; i < n; i++) {
      M[i].reset();
    }

    for (int i = 0; i < n; i++) {
      M[i] = A[i];
      if (A[i][j])
        M[i] ^= 1;
    }

    int rnk = 0;
    for (int k = 0; k < n; k++) {
      int p = -1;
      for (int i = k; i < n; i++)
        if (M[i][k]) {
          p = i;
          break;
        }

      if (p == -1) continue;
      swap(M[k], M[p]);
      assert(M[k][k]);
      for (int i = 0; i < n; i++) if (i != k && M[i][k]) {
        M[i] ^= M[k];
      }
      ++rnk;
    }


    debug(rnk);
    /* for (int i = 0; i < n; i++) */
    /*   debug(M[i]); */
  }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3584kb

input:

2

output:


result:

wrong output format Unexpected end of file - token expected