# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
73206 | test | Judge Against Wrong Code (FXCUP3_judge) | C++14 | 426 ms | 15404 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int MN = 500010;
int X, D, C;
int cnt1[1 << 20], cnt2[1 << 20];
int dp1[1 << 20], dp2[1 << 20];
int ans[MN];
int main() {
scanf("%d", &X);
scanf("%d", &D);
for(int i = 0; i < D; i++) {
getchar();
int mask = 0;
for(int j = 0; j < X; j++) {
char t = getchar();
if(t == 'o') mask ^= (1 << j);
}
cnt1[mask]++;
}
scanf("%d", &C);
for(int i = 0; i < C; i++) {
getchar();
int mask = 0;
for(int j = 0; j < X; j++) {
char t = getchar();
if(t == 'x') mask ^= (1 << j);
}
cnt2[mask]++;
}
for(int i = 0; i < (1 << X); i++) {
dp1[i] = cnt1[i]? i : 0;
dp2[i] = cnt2[i];
}
for(int i = X - 1; i >= 0; i--) {
for(int j = (1 << X) - 1; j >= 0; j--) {
if(j & (1 << i)) {
dp1[j] |= dp1[j ^ (1 << i)];
dp2[j] += dp2[j ^ (1 << i)];
}
}
}
for(int i = 0; i < (1 << X); i++) {
if(dp1[i] == i) {
ans[ C - dp2[(1 << X) - 1 - i] ] = 1;
}
}
for(int i = 1; i <= C; i++) {
if(ans[i]) printf("o");
else printf("x");
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |