#include<stdio.h> int t; int len1,len2; int a,b,c,d; int array1[1000000]; int array2[1000000]; int array3[2000000]; int l1,l2; int main(int argc, char *argv[]) { scanf("%d",&t); while(t--) { scanf("%d%d",&len1,&len2); for(int i=0;i<len1;++i) scanf("%d",&array1[i]); for(int i=0;i<len2;++i) scanf("%d",&array2[i]); scanf("%d%d%d%d",&a,&b,&c,&d); int j=0; for(int i=a-1;i<b;++i) array3[j++]=array1[i]; for(int i=c-1;i<d;++i) array3[j++]=array2[i]; printf("%d\n",array3[(j-1)/2]); } return 0; } /************************************************************** Problem: 1097 User: kirchhoff Language: C Result: Accepted Time:50 ms Memory:16540 kb ****************************************************************/
原文地址:http://blog.csdn.net/wdkirchhoff/article/details/42219105