QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#522972 | #5533. Trick | sleepntsheep | 0 | 4ms | 1640kb | C++14 | 749b | 2024-08-17 17:39:35 | 2024-08-17 17:39:35 |
answer
#include <stdio.h>
#include <stdlib.h>
int t, r, n, a, z, b, c, d, di[20], x[10];
int main() {
srand(868686);
for (int i = 0; i < sizeof di / sizeof *di; ++i)
di[i] = rand() % 16;
scanf("%d%d", &t, &r);
if (r <= 2) {
while (t--) {
z = 0;
scanf("%d", &n);
for (int i = 0; i <= n * 2; ++i) z ^= i;
for (int i = 0; i < n; ++i) scanf("%d", x + i), z ^= x[i];
for (int i = 0; i < n; ++i) for (int j = i + 1; j < n; ++j)
if ((di[x[i]] ^ di[x[j]]) == z) {
printf("%d %d\n", i, j);
goto NX;
}
NX:;
}
} else {
while (t--) {
scanf("%d%d%d%d", &a, &b, &c, &d);
printf("%d\n", di[a] ^ di[b] ^ di[c] ^ di[d]);
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 4ms = 0ms + 4ms
memory: 0kb,1640kb
input:
12012 1 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 4 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 6 6 0 1 2 3 5 ...
output:
0 4 0 4 0 4 0 4 0 4 0 4 0 4 0 1 0 1 0 1 0 1 0 1 0 1 0 1 3 5 3 5 3 5 3 5 3 5 3 5 3 5 2 3 2 3 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2 3 0 2 6 2 3 0 5 6 2 3 0 3 6 2 3 1 2 6 0 1 0 1 6 ...
output:
8 15 1 6 15 8 5 10 15 8 10 7 7 13 8 10 7 5 1 10 12 2 5 9 11 1 15 9 5 7 2 2 6 5 8 10 5 6 2 0 10 7 2 9 6 9 14 10 12 8 9 14 13 8 0 5 13 10 1 2 10 5 10 13 3 2 1 7 13 3 8 10 2 12 13 7 4 14 11 0 8 12 1 2 10 15 8 7 15 15 10 4 7 15 15 8 5 6 1 7 5 2 15 2 0 2 8 2 10 15 10 2 6 2 4 2 2 5 13 15 2 1 8 0 2 5 9 6 1...
result:
wrong answer the card you returned is 8, but expected 6 (test case 1)
Subtask #2:
score: 0
Skipped
Subtask #3:
score: 0
Runtime Error
Test #11:
score: 0
Runtime Error
input:
6525 1 6 10 1 11 3 12 6 6 1 7 10 12 5 6 6 0 10 12 7 9 8 6 12 1 8 4 7 11 6 11 8 9 4 10 6 6 0 7 2 3 4 5 6 0 8 3 10 11 6 6 0 1 2 4 7 6 6 0 1 11 9 5 6 6 7 1 12 8 6 5 7 0 1 13 10 12 5 6 7 0 14 2 3 4 12 6 7 11 1 3 8 12 6 13 7 0 1 2 3 13 5 14 7 11 9 10 8 4 14 7 7 0 8 14 3 4 13 11 7 0 10 2 14 8 5 6 7 0 13 2...
output:
4 5 0 3 0 5 0 4 1 5 1 4 0 3 0 3 0 4 1 6 0 2 1 3 0 4 0 2 3 6 1 7 0 6 0 8 1 2 5 7 4 6 1 5 0 1 3 7 0 4 1 5 0 8 3 6 1 5 3 4 1 5 4 8 0 1 0 7 0 6 1 5 2 10 1 6 1 8 2 10 0 7 0 1 0 1 1 9 2 4 1 7 0 5 1 5 0 5 1 8 0 7 1 6 0 2 0 3 4 6 1 6 1 4 0 8 1 7 0 7 2 8 0 7 0 3 1 3 1 6 1 6 3 10 1 5 0 7 0 1 0 9 0 9 0 7 0 6 1...
input:
6525 2 6 0 2 4 5 8 9 6 2 3 4 8 9 11 6 1 2 3 4 5 11 6 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