Data Structure? Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description Data structure is one of the basic skills for Computer Science students, which is a particular way of storing and organizing data
题目链接:第k个数 题意:求n个数中第k小的数 题解: //由快速排序算法演变而来的快速选择算法 #include<iostream> using namespace std; const int N=1e5+10; int a[N]; //k是整个区间中的第k小的数. void quick(int l,int r,int k) {//快速选择算法保证每次递归时都递归到答案所在的区间. int i=l-1,j=r+1,x=a[l+r>>1]; if(l>=r)return a
KiKi's K-Number Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3864 Accepted Submission(s): 1715 Problem Description For the k-th number, we all should be very familiar with it. Of course,to
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3949 XOR Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4731 Accepted Submission(s): 1658 Problem Description XOR is a kind of bit operator, we
传送门 Description There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: nums1 = [1, 3] nums2 = [2] The median is 2.0 Exampl