QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#308204 | #6652. 着色 | ckiseki# | WA | 3ms | 3584kb | C++20 | 1.8kb | 2024-01-19 18:33:47 | 2024-01-19 18:33:48 |
Judging History
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]); */
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 3584kb
input:
2
output:
result:
wrong output format Unexpected end of file - token expected