简单题。
附ac代码:
#include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b){
return *(int *)a - *(int *)b;
}
int main(){
int t, n, *a, *b, score;
scanf("%d", &t);
while(t-- && scanf("%d", &n)){
a = (int *)malloc(sizeof(int) * n);
b = (int *)malloc(sizeof(int) * n);
for(int i = 0; i != n; ++i)
scanf("%d", &a[i]);
for(int i = 0; i != n; ++i)
scanf("%d", &b[i]);
qsort(a, n, sizeof(int), cmp);
qsort(b, n, sizeof(int), cmp);
score = 0;
for(int i = 0; i != n; ++i)
if(a[i] > b[i]) ++score;
else if(a[i] < b[i]) --score;
if(score)
printf(score > 0 ? "X\n" : "Y\n");
else printf("none\n");
free(a);
free(b);
}
return 0;
}