# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72892 | ainta | Judge Against Wrong Code (FXCUP3_judge) | C++17 | 582 ms | 101580 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<cstdio>
#include<algorithm>
using namespace std;
int K, n, m, A[1<<20], B[1<<20], C[21][1<<20], CA[1<<20], CB[1<<20], vis[1<<20];
char p[22], q[10] = "xo";
void Calc(int *a) {
int i, j;
for (i = 0; i < (1 << K); i++)C[0][i] = a[i];
for (i = 0; i < K; i++) {
for (j = 0; j < (1 << K); j++) {
if ((j >> i) & 1) {
C[i + 1][j] = C[i][j] + C[i][j ^ (1 << i)];
}
else C[i + 1][j] = C[i][j];
}
}
}
int main() {
int i, j;
scanf("%d%d", &K, &n);
for (i = 0; i < n; i++) {
scanf("%s", p);
int s = 0;
for (j = 0; j < K; j++) {
if (p[j] == 'o')s += (1 << j);
}
A[s]++;
}
scanf("%d", &m);
for (i = 0; i < m; i++) {
scanf("%s", p);
int s = 0;
for (j = 0; j < K; j++) {
if (p[j] == 'x')s += (1 << j);
}
B[s]++;
}
Calc(A);
for (i = 0; i < (1 << K); i++)CA[i] = C[K][i];
Calc(B);
for (i = 0; i < (1 << K); i++)CB[i] = C[K][i];
for (i = 1; i < (1 << K); i++) {
for (j = 0; j < K; j++) {
if (((i >> j) & 1) && CA[i] == CA[i ^ (1 << j)])break;
}
if (j == K) {
vis[m - CB[(1 << K) - 1 - i]] = 1;
}
}
for (i = 1; i <= m; i++)printf("%c", q[vis[i]]);
puts("");
return 0;
}
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... |